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',
153 'contact_id' => array(
154 'name' => 'contact_id',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('Action Schedule Contact ID') ,
157 'description' => 'FK to Contact ID',
158 'table_name' => 'civicrm_action_log',
159 'entity' => 'ActionLog',
160 'bao' => 'CRM_Core_BAO_ActionLog',
162 'FKClassName' => 'CRM_Contact_DAO_Contact',
164 'entity_id' => array(
165 'name' => 'entity_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Entity ID') ,
168 'description' => 'FK to id of the entity that the action was performed on. Pseudo - FK.',
170 'table_name' => 'civicrm_action_log',
171 'entity' => 'ActionLog',
172 'bao' => 'CRM_Core_BAO_ActionLog',
175 'entity_table' => array(
176 'name' => 'entity_table',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Entity Table') ,
179 'description' => 'name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant',
181 'size' => CRM_Utils_Type
::HUGE
,
182 'table_name' => 'civicrm_action_log',
183 'entity' => 'ActionLog',
184 'bao' => 'CRM_Core_BAO_ActionLog',
187 'action_schedule_id' => array(
188 'name' => 'action_schedule_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Schedule') ,
191 'description' => 'FK to the action schedule that this action originated from.',
193 'table_name' => 'civicrm_action_log',
194 'entity' => 'ActionLog',
195 'bao' => 'CRM_Core_BAO_ActionLog',
197 'FKClassName' => 'CRM_Core_DAO_ActionSchedule',
199 'action_date_time' => array(
200 'name' => 'action_date_time',
201 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
202 'title' => ts('Action Date And Time') ,
203 'description' => 'date time that the action was performed on.',
204 'table_name' => 'civicrm_action_log',
205 'entity' => 'ActionLog',
206 'bao' => 'CRM_Core_BAO_ActionLog',
210 'name' => 'is_error',
211 'type' => CRM_Utils_Type
::T_BOOLEAN
,
212 'title' => ts('Error?') ,
213 'description' => 'Was there any error sending the reminder?',
214 'table_name' => 'civicrm_action_log',
215 'entity' => 'ActionLog',
216 'bao' => 'CRM_Core_BAO_ActionLog',
221 'type' => CRM_Utils_Type
::T_TEXT
,
222 'title' => ts('Message') ,
223 'description' => 'Description / text in case there was an error encountered.',
224 'table_name' => 'civicrm_action_log',
225 'entity' => 'ActionLog',
226 'bao' => 'CRM_Core_BAO_ActionLog',
229 'repetition_number' => array(
230 'name' => 'repetition_number',
231 'type' => CRM_Utils_Type
::T_INT
,
232 'title' => ts('Repetition Number') ,
233 'description' => 'Keeps track of the sequence number of this repetition.',
234 'table_name' => 'civicrm_action_log',
235 'entity' => 'ActionLog',
236 'bao' => 'CRM_Core_BAO_ActionLog',
239 'reference_date' => array(
240 'name' => 'reference_date',
241 'type' => CRM_Utils_Type
::T_DATE
,
242 'title' => ts('Reference Date') ,
243 'description' => 'Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)',
245 'table_name' => 'civicrm_action_log',
246 'entity' => 'ActionLog',
247 'bao' => 'CRM_Core_BAO_ActionLog',
251 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
253 return Civi
::$statics[__CLASS__
]['fields'];
256 * Return a mapping from field-name to the corresponding key (as used in fields()).
259 * Array(string $name => string $uniqueName).
261 static function &fieldKeys() {
262 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
263 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
265 return Civi
::$statics[__CLASS__
]['fieldKeys'];
268 * Returns the names of this table
272 static function getTableName() {
273 return self
::$_tableName;
276 * Returns if this table needs to be logged
284 * Returns the list of fields that can be imported
286 * @param bool $prefix
290 static function &import($prefix = false) {
291 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'action_log', $prefix, array());
295 * Returns the list of fields that can be exported
297 * @param bool $prefix
301 static function &export($prefix = false) {
302 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'action_log', $prefix, array());
306 * Returns the list of indices
308 public static function indices($localize = TRUE) {
310 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;