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