5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/ActionLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b2a5ecdfd400bdf2fe892f9391f8a7ea)
13 * Database access object for the ActionLog entity.
15 class CRM_Core_DAO_ActionLog
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.4';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_action_log';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
46 * FK to id of the entity that the action was performed on. Pseudo - FK.
53 * name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant
60 * FK to the action schedule that this action originated from.
64 public $action_schedule_id;
67 * date time that the action was performed on.
71 public $action_date_time;
74 * Was there any error sending the reminder?
81 * Description / text in case there was an error encountered.
88 * Keeps track of the sequence number of this repetition.
92 public $repetition_number;
95 * Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)
99 public $reference_date;
104 public function __construct() {
105 $this->__table
= 'civicrm_action_log';
106 parent
::__construct();
110 * Returns localized title of this entity.
112 * @param bool $plural
113 * Whether to return the plural version of the title.
115 public static function getEntityTitle($plural = FALSE) {
116 return $plural ?
ts('Action Logs') : ts('Action Log');
120 * Returns foreign keys and entity references.
123 * [CRM_Core_Reference_Interface]
125 public static function getReferenceColumns() {
126 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
127 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
128 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
129 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'action_schedule_id', 'civicrm_action_schedule', 'id');
130 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
133 return Civi
::$statics[__CLASS__
]['links'];
137 * Returns all the column names of this table
141 public static function &fields() {
142 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
143 Civi
::$statics[__CLASS__
]['fields'] = [
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Action Schedule ID'),
149 'where' => 'civicrm_action_log.id',
150 'table_name' => 'civicrm_action_log',
151 'entity' => 'ActionLog',
152 'bao' => 'CRM_Core_BAO_ActionLog',
161 'name' => 'contact_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Contact ID'),
164 'description' => ts('FK to Contact ID'),
165 'where' => 'civicrm_action_log.contact_id',
166 'table_name' => 'civicrm_action_log',
167 'entity' => 'ActionLog',
168 'bao' => 'CRM_Core_BAO_ActionLog',
170 'FKClassName' => 'CRM_Contact_DAO_Contact',
172 'label' => ts("Contact"),
177 'name' => 'entity_id',
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Entity ID'),
180 'description' => ts('FK to id of the entity that the action was performed on. Pseudo - FK.'),
182 'where' => 'civicrm_action_log.entity_id',
183 'table_name' => 'civicrm_action_log',
184 'entity' => 'ActionLog',
185 'bao' => 'CRM_Core_BAO_ActionLog',
190 'name' => 'entity_table',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('Entity Table'),
193 'description' => ts('name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant'),
195 'size' => CRM_Utils_Type
::HUGE
,
196 'where' => 'civicrm_action_log.entity_table',
197 'table_name' => 'civicrm_action_log',
198 'entity' => 'ActionLog',
199 'bao' => 'CRM_Core_BAO_ActionLog',
203 'action_schedule_id' => [
204 'name' => 'action_schedule_id',
205 'type' => CRM_Utils_Type
::T_INT
,
206 'title' => ts('Schedule ID'),
207 'description' => ts('FK to the action schedule that this action originated from.'),
209 'where' => 'civicrm_action_log.action_schedule_id',
210 'table_name' => 'civicrm_action_log',
211 'entity' => 'ActionLog',
212 'bao' => 'CRM_Core_BAO_ActionLog',
214 'FKClassName' => 'CRM_Core_DAO_ActionSchedule',
216 'label' => ts("Schedule"),
220 'action_date_time' => [
221 'name' => 'action_date_time',
222 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
223 'title' => ts('Action Date And Time'),
224 'description' => ts('date time that the action was performed on.'),
225 'where' => 'civicrm_action_log.action_date_time',
226 'table_name' => 'civicrm_action_log',
227 'entity' => 'ActionLog',
228 'bao' => 'CRM_Core_BAO_ActionLog',
233 'name' => 'is_error',
234 'type' => CRM_Utils_Type
::T_BOOLEAN
,
235 'title' => ts('Error?'),
236 'description' => ts('Was there any error sending the reminder?'),
237 'where' => 'civicrm_action_log.is_error',
239 'table_name' => 'civicrm_action_log',
240 'entity' => 'ActionLog',
241 'bao' => 'CRM_Core_BAO_ActionLog',
247 'type' => CRM_Utils_Type
::T_TEXT
,
248 'title' => ts('Message'),
249 'description' => ts('Description / text in case there was an error encountered.'),
250 'where' => 'civicrm_action_log.message',
251 'table_name' => 'civicrm_action_log',
252 'entity' => 'ActionLog',
253 'bao' => 'CRM_Core_BAO_ActionLog',
257 'repetition_number' => [
258 'name' => 'repetition_number',
259 'type' => CRM_Utils_Type
::T_INT
,
260 'title' => ts('Repetition Number'),
261 'description' => ts('Keeps track of the sequence number of this repetition.'),
262 'where' => 'civicrm_action_log.repetition_number',
263 'table_name' => 'civicrm_action_log',
264 'entity' => 'ActionLog',
265 'bao' => 'CRM_Core_BAO_ActionLog',
269 'reference_date' => [
270 'name' => 'reference_date',
271 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
272 'title' => ts('Reference Date'),
273 'description' => ts('Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)'),
274 'where' => 'civicrm_action_log.reference_date',
276 'table_name' => 'civicrm_action_log',
277 'entity' => 'ActionLog',
278 'bao' => 'CRM_Core_BAO_ActionLog',
283 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
285 return Civi
::$statics[__CLASS__
]['fields'];
289 * Return a mapping from field-name to the corresponding key (as used in fields()).
292 * Array(string $name => string $uniqueName).
294 public static function &fieldKeys() {
295 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
296 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
298 return Civi
::$statics[__CLASS__
]['fieldKeys'];
302 * Returns the names of this table
306 public static function getTableName() {
307 return self
::$_tableName;
311 * Returns if this table needs to be logged
315 public function getLog() {
320 * Returns the list of fields that can be imported
322 * @param bool $prefix
326 public static function &import($prefix = FALSE) {
327 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_log', $prefix, []);
332 * Returns the list of fields that can be exported
334 * @param bool $prefix
338 public static function &export($prefix = FALSE) {
339 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_log', $prefix, []);
344 * Returns the list of indices
346 * @param bool $localize
350 public static function indices($localize = TRUE) {
352 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;