5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/ActionLog.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:38f897676ff054f67ba7188470e41dee)
13 * Database access object for the ActionLog entity.
15 class CRM_Core_DAO_ActionLog
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_action_log';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
44 * FK to id of the entity that the action was performed on. Pseudo - FK.
51 * name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant
58 * FK to the action schedule that this action originated from.
62 public $action_schedule_id;
65 * date time that the action was performed on.
69 public $action_date_time;
72 * Was there any error sending the reminder?
79 * Description / text in case there was an error encountered.
86 * Keeps track of the sequence number of this repetition.
90 public $repetition_number;
93 * Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)
97 public $reference_date;
102 public function __construct() {
103 $this->__table
= 'civicrm_action_log';
104 parent
::__construct();
108 * Returns foreign keys and entity references.
111 * [CRM_Core_Reference_Interface]
113 public static function getReferenceColumns() {
114 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
115 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
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');
119 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
121 return Civi
::$statics[__CLASS__
]['links'];
125 * Returns all the column names of this table
129 public static function &fields() {
130 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
131 Civi
::$statics[__CLASS__
]['fields'] = [
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('Action Schedule ID'),
137 'table_name' => 'civicrm_action_log',
138 'entity' => 'ActionLog',
139 'bao' => 'CRM_Core_BAO_ActionLog',
143 'name' => 'contact_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Action Schedule Contact ID'),
146 'description' => ts('FK to Contact ID'),
147 'table_name' => 'civicrm_action_log',
148 'entity' => 'ActionLog',
149 'bao' => 'CRM_Core_BAO_ActionLog',
151 'FKClassName' => 'CRM_Contact_DAO_Contact',
154 'name' => 'entity_id',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('Entity ID'),
157 'description' => ts('FK to id of the entity that the action was performed on. Pseudo - FK.'),
159 'table_name' => 'civicrm_action_log',
160 'entity' => 'ActionLog',
161 'bao' => 'CRM_Core_BAO_ActionLog',
165 'name' => 'entity_table',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Entity Table'),
168 'description' => ts('name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant'),
170 'size' => CRM_Utils_Type
::HUGE
,
171 'table_name' => 'civicrm_action_log',
172 'entity' => 'ActionLog',
173 'bao' => 'CRM_Core_BAO_ActionLog',
176 'action_schedule_id' => [
177 'name' => 'action_schedule_id',
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Schedule'),
180 'description' => ts('FK to the action schedule that this action originated from.'),
182 'table_name' => 'civicrm_action_log',
183 'entity' => 'ActionLog',
184 'bao' => 'CRM_Core_BAO_ActionLog',
186 'FKClassName' => 'CRM_Core_DAO_ActionSchedule',
188 'action_date_time' => [
189 'name' => 'action_date_time',
190 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
191 'title' => ts('Action Date And Time'),
192 'description' => ts('date time that the action was performed on.'),
193 'table_name' => 'civicrm_action_log',
194 'entity' => 'ActionLog',
195 'bao' => 'CRM_Core_BAO_ActionLog',
199 'name' => 'is_error',
200 'type' => CRM_Utils_Type
::T_BOOLEAN
,
201 'title' => ts('Error?'),
202 'description' => ts('Was there any error sending the reminder?'),
204 'table_name' => 'civicrm_action_log',
205 'entity' => 'ActionLog',
206 'bao' => 'CRM_Core_BAO_ActionLog',
211 'type' => CRM_Utils_Type
::T_TEXT
,
212 'title' => ts('Message'),
213 'description' => ts('Description / text in case there was an error encountered.'),
214 'table_name' => 'civicrm_action_log',
215 'entity' => 'ActionLog',
216 'bao' => 'CRM_Core_BAO_ActionLog',
219 'repetition_number' => [
220 'name' => 'repetition_number',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Repetition Number'),
223 'description' => ts('Keeps track of the sequence number of this repetition.'),
224 'table_name' => 'civicrm_action_log',
225 'entity' => 'ActionLog',
226 'bao' => 'CRM_Core_BAO_ActionLog',
229 'reference_date' => [
230 'name' => 'reference_date',
231 'type' => CRM_Utils_Type
::T_DATE
,
232 'title' => ts('Reference Date'),
233 'description' => ts('Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)'),
235 'table_name' => 'civicrm_action_log',
236 'entity' => 'ActionLog',
237 'bao' => 'CRM_Core_BAO_ActionLog',
241 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
243 return Civi
::$statics[__CLASS__
]['fields'];
247 * Return a mapping from field-name to the corresponding key (as used in fields()).
250 * Array(string $name => string $uniqueName).
252 public static function &fieldKeys() {
253 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
254 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
256 return Civi
::$statics[__CLASS__
]['fieldKeys'];
260 * Returns the names of this table
264 public static function getTableName() {
265 return self
::$_tableName;
269 * Returns if this table needs to be logged
273 public function getLog() {
278 * Returns the list of fields that can be imported
280 * @param bool $prefix
284 public static function &import($prefix = FALSE) {
285 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_log', $prefix, []);
290 * Returns the list of fields that can be exported
292 * @param bool $prefix
296 public static function &export($prefix = FALSE) {
297 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_log', $prefix, []);
302 * Returns the list of indices
304 * @param bool $localize
308 public static function indices($localize = TRUE) {
310 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;