CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Core / DAO / Log.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/Log.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
022785d8 33 * (GenCodeChecksum:8ba1221b34b495c2238ecf5197e5a47f)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_Log constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_Log extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_log';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Log ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Name of table where item being referenced is stored.
61 *
62 * @var string
63 */
64 public $entity_table;
65 /**
66 * Foreign key to the referenced item.
67 *
68 * @var int unsigned
69 */
70 public $entity_id;
71 /**
72 * Updates does to this object if any.
73 *
74 * @var text
75 */
76 public $data;
77 /**
78 * FK to Contact ID of person under whose credentials this data modification was made.
79 *
80 * @var int unsigned
81 */
82 public $modified_id;
83 /**
84 * When was the referenced entity created or modified or deleted.
85 *
86 * @var datetime
87 */
88 public $modified_date;
89 /**
f41f0342 90 * Class constructor.
e501603b
TO
91 */
92 function __construct() {
93 $this->__table = 'civicrm_log';
94 parent::__construct();
95 }
96 /**
f41f0342 97 * Returns foreign keys and entity references.
e501603b
TO
98 *
99 * @return array
100 * [CRM_Core_Reference_Interface]
101 */
102 static function getReferenceColumns() {
346aaaba
TO
103 if (!isset(Civi::$statics[__CLASS__]['links'])) {
104 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
105 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
106 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
107 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 108 }
346aaaba 109 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
110 }
111 /**
112 * Returns all the column names of this table
113 *
114 * @return array
115 */
116 static function &fields() {
346aaaba
TO
117 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
118 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
119 'id' => array(
120 'name' => 'id',
121 'type' => CRM_Utils_Type::T_INT,
122 'title' => ts('Log ID') ,
123 'description' => 'Log ID',
124 'required' => true,
522a26c9 125 'table_name' => 'civicrm_log',
126 'entity' => 'Log',
127 'bao' => 'CRM_Core_BAO_Log',
6a7e5e5d 128 'localizable' => 0,
e501603b
TO
129 ) ,
130 'entity_table' => array(
131 'name' => 'entity_table',
132 'type' => CRM_Utils_Type::T_STRING,
133 'title' => ts('Entity Table') ,
134 'description' => 'Name of table where item being referenced is stored.',
135 'required' => true,
136 'maxlength' => 64,
137 'size' => CRM_Utils_Type::BIG,
522a26c9 138 'table_name' => 'civicrm_log',
139 'entity' => 'Log',
140 'bao' => 'CRM_Core_BAO_Log',
6a7e5e5d 141 'localizable' => 0,
e501603b
TO
142 ) ,
143 'entity_id' => array(
144 'name' => 'entity_id',
145 'type' => CRM_Utils_Type::T_INT,
146 'title' => ts('Entity ID ') ,
147 'description' => 'Foreign key to the referenced item.',
148 'required' => true,
522a26c9 149 'table_name' => 'civicrm_log',
150 'entity' => 'Log',
151 'bao' => 'CRM_Core_BAO_Log',
6a7e5e5d 152 'localizable' => 0,
e501603b
TO
153 ) ,
154 'data' => array(
155 'name' => 'data',
156 'type' => CRM_Utils_Type::T_TEXT,
157 'title' => ts('Data') ,
158 'description' => 'Updates does to this object if any.',
522a26c9 159 'table_name' => 'civicrm_log',
160 'entity' => 'Log',
161 'bao' => 'CRM_Core_BAO_Log',
6a7e5e5d 162 'localizable' => 0,
e501603b
TO
163 ) ,
164 'modified_id' => array(
165 'name' => 'modified_id',
166 'type' => CRM_Utils_Type::T_INT,
167 'title' => ts('Modified By') ,
168 'description' => 'FK to Contact ID of person under whose credentials this data modification was made.',
522a26c9 169 'table_name' => 'civicrm_log',
170 'entity' => 'Log',
171 'bao' => 'CRM_Core_BAO_Log',
6a7e5e5d 172 'localizable' => 0,
e501603b
TO
173 'FKClassName' => 'CRM_Contact_DAO_Contact',
174 ) ,
175 'modified_date' => array(
176 'name' => 'modified_date',
177 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
178 'title' => ts('Modified Date') ,
179 'description' => 'When was the referenced entity created or modified or deleted.',
522a26c9 180 'table_name' => 'civicrm_log',
181 'entity' => 'Log',
182 'bao' => 'CRM_Core_BAO_Log',
6a7e5e5d 183 'localizable' => 0,
e501603b
TO
184 ) ,
185 );
346aaaba 186 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 187 }
346aaaba 188 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
189 }
190 /**
bd8e0b14 191 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
192 *
193 * @return array
bd8e0b14 194 * Array(string $name => string $uniqueName).
e501603b
TO
195 */
196 static function &fieldKeys() {
bd8e0b14
TO
197 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
198 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 199 }
bd8e0b14 200 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
201 }
202 /**
203 * Returns the names of this table
204 *
205 * @return string
206 */
207 static function getTableName() {
208 return self::$_tableName;
209 }
210 /**
211 * Returns if this table needs to be logged
212 *
213 * @return boolean
214 */
215 function getLog() {
216 return self::$_log;
217 }
218 /**
219 * Returns the list of fields that can be imported
220 *
221 * @param bool $prefix
222 *
223 * @return array
224 */
225 static function &import($prefix = false) {
60808919
TO
226 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'log', $prefix, array());
227 return $r;
e501603b
TO
228 }
229 /**
230 * Returns the list of fields that can be exported
231 *
232 * @param bool $prefix
233 *
234 * @return array
235 */
236 static function &export($prefix = false) {
60808919
TO
237 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'log', $prefix, array());
238 return $r;
e501603b
TO
239 }
240}