3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/ActionLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:4ef96df03630ecc884c881b79a40818f)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_ActionLog constructor.
40 class CRM_Core_DAO_ActionLog
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_action_log';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
65 * FK to id of the entity that the action was performed on. Pseudo - FK.
71 * name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant
77 * FK to the action schedule that this action originated from.
81 public $action_schedule_id;
83 * date time that the action was performed on.
87 public $action_date_time;
89 * Was there any error sending the reminder?
95 * Description / text in case there was an error encountered.
101 * Keeps track of the sequence number of this repetition.
105 public $repetition_number;
107 * Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)
111 public $reference_date;
115 function __construct() {
116 $this->__table
= 'civicrm_action_log';
117 parent
::__construct();
120 * Returns foreign keys and entity references.
123 * [CRM_Core_Reference_Interface]
125 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'];
136 * Returns all the column names of this table
140 static function &fields() {
141 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
142 Civi
::$statics[__CLASS__
]['fields'] = array(
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Action Schedule ID') ,
148 'table_name' => 'civicrm_action_log',
149 'entity' => 'ActionLog',
150 'bao' => 'CRM_Core_BAO_ActionLog',
152 'contact_id' => array(
153 'name' => 'contact_id',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Action Schedule Contact ID') ,
156 'description' => 'FK to Contact ID',
157 'table_name' => 'civicrm_action_log',
158 'entity' => 'ActionLog',
159 'bao' => 'CRM_Core_BAO_ActionLog',
160 'FKClassName' => 'CRM_Contact_DAO_Contact',
162 'entity_id' => array(
163 'name' => 'entity_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Entity ID') ,
166 'description' => 'FK to id of the entity that the action was performed on. Pseudo - FK.',
168 'table_name' => 'civicrm_action_log',
169 'entity' => 'ActionLog',
170 'bao' => 'CRM_Core_BAO_ActionLog',
172 'entity_table' => array(
173 'name' => 'entity_table',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Entity Table') ,
176 'description' => 'name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant',
178 'size' => CRM_Utils_Type
::HUGE
,
179 'table_name' => 'civicrm_action_log',
180 'entity' => 'ActionLog',
181 'bao' => 'CRM_Core_BAO_ActionLog',
183 'action_schedule_id' => array(
184 'name' => 'action_schedule_id',
185 'type' => CRM_Utils_Type
::T_INT
,
186 'title' => ts('Schedule') ,
187 'description' => 'FK to the action schedule that this action originated from.',
189 'table_name' => 'civicrm_action_log',
190 'entity' => 'ActionLog',
191 'bao' => 'CRM_Core_BAO_ActionLog',
192 'FKClassName' => 'CRM_Core_DAO_ActionSchedule',
194 'action_date_time' => array(
195 'name' => 'action_date_time',
196 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
197 'title' => ts('Action Date And Time') ,
198 'description' => 'date time that the action was performed on.',
199 'table_name' => 'civicrm_action_log',
200 'entity' => 'ActionLog',
201 'bao' => 'CRM_Core_BAO_ActionLog',
204 'name' => 'is_error',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Error?') ,
207 'description' => 'Was there any error sending the reminder?',
208 'table_name' => 'civicrm_action_log',
209 'entity' => 'ActionLog',
210 'bao' => 'CRM_Core_BAO_ActionLog',
214 'type' => CRM_Utils_Type
::T_TEXT
,
215 'title' => ts('Message') ,
216 'description' => 'Description / text in case there was an error encountered.',
217 'table_name' => 'civicrm_action_log',
218 'entity' => 'ActionLog',
219 'bao' => 'CRM_Core_BAO_ActionLog',
221 'repetition_number' => array(
222 'name' => 'repetition_number',
223 'type' => CRM_Utils_Type
::T_INT
,
224 'title' => ts('Repetition Number') ,
225 'description' => 'Keeps track of the sequence number of this repetition.',
226 'table_name' => 'civicrm_action_log',
227 'entity' => 'ActionLog',
228 'bao' => 'CRM_Core_BAO_ActionLog',
230 'reference_date' => array(
231 'name' => 'reference_date',
232 'type' => CRM_Utils_Type
::T_DATE
,
233 'title' => ts('Reference Date') ,
234 'description' => 'Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)',
236 'table_name' => 'civicrm_action_log',
237 'entity' => 'ActionLog',
238 'bao' => 'CRM_Core_BAO_ActionLog',
241 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
243 return Civi
::$statics[__CLASS__
]['fields'];
246 * Return a mapping from field-name to the corresponding key (as used in fields()).
249 * Array(string $name => string $uniqueName).
251 static function &fieldKeys() {
252 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
253 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
255 return Civi
::$statics[__CLASS__
]['fieldKeys'];
258 * Returns the names of this table
262 static function getTableName() {
263 return self
::$_tableName;
266 * Returns if this table needs to be logged
274 * Returns the list of fields that can be imported
276 * @param bool $prefix
280 static function &import($prefix = false) {
281 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_log', $prefix, array());
285 * Returns the list of fields that can be exported
287 * @param bool $prefix
291 static function &export($prefix = false) {
292 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_log', $prefix, array());