Merge pull request #22941 from sunilpawar/batch_copy_radio_clear_value
[civicrm-core.git] / CRM / Core / DAO / ActionLog.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/ActionLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f3a6da0a3e4c1c9601265c8ad6eb85f4)
10 */
11
12 /**
13 * Database access object for the ActionLog entity.
14 */
15 class CRM_Core_DAO_ActionLog extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '3.4';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_action_log';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
37 */
38 public $id;
39
40 /**
41 * FK to Contact ID
42 *
43 * @var int|string|null
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
46 */
47 public $contact_id;
48
49 /**
50 * FK to id of the entity that the action was performed on. Pseudo - FK.
51 *
52 * @var int|string
53 * (SQL type: int unsigned)
54 * Note that values will be retrieved from the database as a string.
55 */
56 public $entity_id;
57
58 /**
59 * name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant
60 *
61 * @var string|null
62 * (SQL type: varchar(255))
63 * Note that values will be retrieved from the database as a string.
64 */
65 public $entity_table;
66
67 /**
68 * FK to the action schedule that this action originated from.
69 *
70 * @var int|string
71 * (SQL type: int unsigned)
72 * Note that values will be retrieved from the database as a string.
73 */
74 public $action_schedule_id;
75
76 /**
77 * date time that the action was performed on.
78 *
79 * @var string|null
80 * (SQL type: datetime)
81 * Note that values will be retrieved from the database as a string.
82 */
83 public $action_date_time;
84
85 /**
86 * Was there any error sending the reminder?
87 *
88 * @var bool|string
89 * (SQL type: tinyint)
90 * Note that values will be retrieved from the database as a string.
91 */
92 public $is_error;
93
94 /**
95 * Description / text in case there was an error encountered.
96 *
97 * @var string|null
98 * (SQL type: text)
99 * Note that values will be retrieved from the database as a string.
100 */
101 public $message;
102
103 /**
104 * Keeps track of the sequence number of this repetition.
105 *
106 * @var int|string|null
107 * (SQL type: int unsigned)
108 * Note that values will be retrieved from the database as a string.
109 */
110 public $repetition_number;
111
112 /**
113 * Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)
114 *
115 * @var string|null
116 * (SQL type: datetime)
117 * Note that values will be retrieved from the database as a string.
118 */
119 public $reference_date;
120
121 /**
122 * Class constructor.
123 */
124 public function __construct() {
125 $this->__table = 'civicrm_action_log';
126 parent::__construct();
127 }
128
129 /**
130 * Returns localized title of this entity.
131 *
132 * @param bool $plural
133 * Whether to return the plural version of the title.
134 */
135 public static function getEntityTitle($plural = FALSE) {
136 return $plural ? ts('Action Logs') : ts('Action Log');
137 }
138
139 /**
140 * Returns foreign keys and entity references.
141 *
142 * @return array
143 * [CRM_Core_Reference_Interface]
144 */
145 public static function getReferenceColumns() {
146 if (!isset(Civi::$statics[__CLASS__]['links'])) {
147 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
148 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
149 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'action_schedule_id', 'civicrm_action_schedule', 'id');
150 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
151 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
152 }
153 return Civi::$statics[__CLASS__]['links'];
154 }
155
156 /**
157 * Returns all the column names of this table
158 *
159 * @return array
160 */
161 public static function &fields() {
162 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
163 Civi::$statics[__CLASS__]['fields'] = [
164 'id' => [
165 'name' => 'id',
166 'type' => CRM_Utils_Type::T_INT,
167 'title' => ts('Action Schedule ID'),
168 'required' => TRUE,
169 'where' => 'civicrm_action_log.id',
170 'table_name' => 'civicrm_action_log',
171 'entity' => 'ActionLog',
172 'bao' => 'CRM_Core_BAO_ActionLog',
173 'localizable' => 0,
174 'html' => [
175 'type' => 'Number',
176 ],
177 'readonly' => TRUE,
178 'add' => '3.4',
179 ],
180 'contact_id' => [
181 'name' => 'contact_id',
182 'type' => CRM_Utils_Type::T_INT,
183 'title' => ts('Contact ID'),
184 'description' => ts('FK to Contact ID'),
185 'where' => 'civicrm_action_log.contact_id',
186 'table_name' => 'civicrm_action_log',
187 'entity' => 'ActionLog',
188 'bao' => 'CRM_Core_BAO_ActionLog',
189 'localizable' => 0,
190 'FKClassName' => 'CRM_Contact_DAO_Contact',
191 'html' => [
192 'label' => ts("Contact"),
193 ],
194 'add' => '3.4',
195 ],
196 'entity_id' => [
197 'name' => 'entity_id',
198 'type' => CRM_Utils_Type::T_INT,
199 'title' => ts('Entity ID'),
200 'description' => ts('FK to id of the entity that the action was performed on. Pseudo - FK.'),
201 'required' => TRUE,
202 'where' => 'civicrm_action_log.entity_id',
203 'table_name' => 'civicrm_action_log',
204 'entity' => 'ActionLog',
205 'bao' => 'CRM_Core_BAO_ActionLog',
206 'localizable' => 0,
207 'add' => '3.4',
208 ],
209 'entity_table' => [
210 'name' => 'entity_table',
211 'type' => CRM_Utils_Type::T_STRING,
212 'title' => ts('Entity Table'),
213 'description' => ts('name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant'),
214 'maxlength' => 255,
215 'size' => CRM_Utils_Type::HUGE,
216 'where' => 'civicrm_action_log.entity_table',
217 'table_name' => 'civicrm_action_log',
218 'entity' => 'ActionLog',
219 'bao' => 'CRM_Core_BAO_ActionLog',
220 'localizable' => 0,
221 'add' => '3.4',
222 ],
223 'action_schedule_id' => [
224 'name' => 'action_schedule_id',
225 'type' => CRM_Utils_Type::T_INT,
226 'title' => ts('Schedule ID'),
227 'description' => ts('FK to the action schedule that this action originated from.'),
228 'required' => TRUE,
229 'where' => 'civicrm_action_log.action_schedule_id',
230 'table_name' => 'civicrm_action_log',
231 'entity' => 'ActionLog',
232 'bao' => 'CRM_Core_BAO_ActionLog',
233 'localizable' => 0,
234 'FKClassName' => 'CRM_Core_DAO_ActionSchedule',
235 'html' => [
236 'label' => ts("Schedule"),
237 ],
238 'add' => '3.4',
239 ],
240 'action_date_time' => [
241 'name' => 'action_date_time',
242 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
243 'title' => ts('Action Date And Time'),
244 'description' => ts('date time that the action was performed on.'),
245 'where' => 'civicrm_action_log.action_date_time',
246 'table_name' => 'civicrm_action_log',
247 'entity' => 'ActionLog',
248 'bao' => 'CRM_Core_BAO_ActionLog',
249 'localizable' => 0,
250 'add' => '3.4',
251 ],
252 'is_error' => [
253 'name' => 'is_error',
254 'type' => CRM_Utils_Type::T_BOOLEAN,
255 'title' => ts('Error?'),
256 'description' => ts('Was there any error sending the reminder?'),
257 'required' => TRUE,
258 'where' => 'civicrm_action_log.is_error',
259 'default' => '0',
260 'table_name' => 'civicrm_action_log',
261 'entity' => 'ActionLog',
262 'bao' => 'CRM_Core_BAO_ActionLog',
263 'localizable' => 0,
264 'add' => '3.4',
265 ],
266 'message' => [
267 'name' => 'message',
268 'type' => CRM_Utils_Type::T_TEXT,
269 'title' => ts('Message'),
270 'description' => ts('Description / text in case there was an error encountered.'),
271 'where' => 'civicrm_action_log.message',
272 'table_name' => 'civicrm_action_log',
273 'entity' => 'ActionLog',
274 'bao' => 'CRM_Core_BAO_ActionLog',
275 'localizable' => 0,
276 'add' => '3.4',
277 ],
278 'repetition_number' => [
279 'name' => 'repetition_number',
280 'type' => CRM_Utils_Type::T_INT,
281 'title' => ts('Repetition Number'),
282 'description' => ts('Keeps track of the sequence number of this repetition.'),
283 'where' => 'civicrm_action_log.repetition_number',
284 'table_name' => 'civicrm_action_log',
285 'entity' => 'ActionLog',
286 'bao' => 'CRM_Core_BAO_ActionLog',
287 'localizable' => 0,
288 'add' => '3.4',
289 ],
290 'reference_date' => [
291 'name' => 'reference_date',
292 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
293 'title' => ts('Reference Date'),
294 'description' => ts('Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)'),
295 'where' => 'civicrm_action_log.reference_date',
296 'default' => NULL,
297 'table_name' => 'civicrm_action_log',
298 'entity' => 'ActionLog',
299 'bao' => 'CRM_Core_BAO_ActionLog',
300 'localizable' => 0,
301 'add' => '4.6',
302 ],
303 ];
304 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
305 }
306 return Civi::$statics[__CLASS__]['fields'];
307 }
308
309 /**
310 * Return a mapping from field-name to the corresponding key (as used in fields()).
311 *
312 * @return array
313 * Array(string $name => string $uniqueName).
314 */
315 public static function &fieldKeys() {
316 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
317 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
318 }
319 return Civi::$statics[__CLASS__]['fieldKeys'];
320 }
321
322 /**
323 * Returns the names of this table
324 *
325 * @return string
326 */
327 public static function getTableName() {
328 return self::$_tableName;
329 }
330
331 /**
332 * Returns if this table needs to be logged
333 *
334 * @return bool
335 */
336 public function getLog() {
337 return self::$_log;
338 }
339
340 /**
341 * Returns the list of fields that can be imported
342 *
343 * @param bool $prefix
344 *
345 * @return array
346 */
347 public static function &import($prefix = FALSE) {
348 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_log', $prefix, []);
349 return $r;
350 }
351
352 /**
353 * Returns the list of fields that can be exported
354 *
355 * @param bool $prefix
356 *
357 * @return array
358 */
359 public static function &export($prefix = FALSE) {
360 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_log', $prefix, []);
361 return $r;
362 }
363
364 /**
365 * Returns the list of indices
366 *
367 * @param bool $localize
368 *
369 * @return array
370 */
371 public static function indices($localize = TRUE) {
372 $indices = [];
373 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
374 }
375
376 }