5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Log.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:38303a678c8e5104d63803ce900dc370)
13 * Database access object for the Log entity.
15 class CRM_Core_DAO_Log
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_log';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * Name of table where item being referenced is stored.
46 * Foreign key to the referenced item.
53 * Updates does to this object if any.
60 * FK to Contact ID of person under whose credentials this data modification was made.
67 * When was the referenced entity created or modified or deleted.
71 public $modified_date;
76 public function __construct() {
77 $this->__table
= 'civicrm_log';
78 parent
::__construct();
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'modified_id', 'civicrm_contact', 'id');
91 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
92 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
94 return Civi
::$statics[__CLASS__
]['links'];
98 * Returns all the column names of this table
102 public static function &fields() {
103 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
104 Civi
::$statics[__CLASS__
]['fields'] = [
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Log ID'),
109 'description' => ts('Log ID'),
111 'table_name' => 'civicrm_log',
113 'bao' => 'CRM_Core_BAO_Log',
117 'name' => 'entity_table',
118 'type' => CRM_Utils_Type
::T_STRING
,
119 'title' => ts('Entity Table'),
120 'description' => ts('Name of table where item being referenced is stored.'),
123 'size' => CRM_Utils_Type
::BIG
,
124 'table_name' => 'civicrm_log',
126 'bao' => 'CRM_Core_BAO_Log',
130 'name' => 'entity_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Entity ID '),
133 'description' => ts('Foreign key to the referenced item.'),
135 'table_name' => 'civicrm_log',
137 'bao' => 'CRM_Core_BAO_Log',
142 'type' => CRM_Utils_Type
::T_TEXT
,
143 'title' => ts('Data'),
144 'description' => ts('Updates does to this object if any.'),
145 'table_name' => 'civicrm_log',
147 'bao' => 'CRM_Core_BAO_Log',
151 'name' => 'modified_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Modified By'),
154 'description' => ts('FK to Contact ID of person under whose credentials this data modification was made.'),
155 'table_name' => 'civicrm_log',
157 'bao' => 'CRM_Core_BAO_Log',
159 'FKClassName' => 'CRM_Contact_DAO_Contact',
162 'name' => 'modified_date',
163 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
164 'title' => ts('Modified Date'),
165 'description' => ts('When was the referenced entity created or modified or deleted.'),
166 'table_name' => 'civicrm_log',
168 'bao' => 'CRM_Core_BAO_Log',
172 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
174 return Civi
::$statics[__CLASS__
]['fields'];
178 * Return a mapping from field-name to the corresponding key (as used in fields()).
181 * Array(string $name => string $uniqueName).
183 public static function &fieldKeys() {
184 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
185 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
187 return Civi
::$statics[__CLASS__
]['fieldKeys'];
191 * Returns the names of this table
195 public static function getTableName() {
196 return self
::$_tableName;
200 * Returns if this table needs to be logged
204 public function getLog() {
209 * Returns the list of fields that can be imported
211 * @param bool $prefix
215 public static function &import($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'log', $prefix, []);
221 * Returns the list of fields that can be exported
223 * @param bool $prefix
227 public static function &export($prefix = FALSE) {
228 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'log', $prefix, []);
233 * Returns the list of indices
235 * @param bool $localize
239 public static function indices($localize = TRUE) {
242 'name' => 'index_entity',
247 'localizable' => FALSE,
248 'sig' => 'civicrm_log::0::entity_table::entity_id',
251 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;