Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2016 | | |
7 | +--------------------------------------------------------------------+ | |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
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. | | |
13 | | | | |
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. | | |
18 | | | | |
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 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
29 | * @copyright CiviCRM LLC (c) 2004-2016 | |
30 | * | |
31 | * Generated from xml/schema/CRM/Core/ActionLog.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:721c03b2046e11d8774a5e14204a28d8) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Core_DAO_ActionLog extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_action_log'; | |
e501603b TO |
44 | /** |
45 | * static value to see if we should log any modifications to | |
46 | * this table in the civicrm_log table | |
47 | * | |
48 | * @var boolean | |
49 | */ | |
50 | static $_log = false; | |
51 | /** | |
52 | * | |
53 | * @var int unsigned | |
54 | */ | |
55 | public $id; | |
56 | /** | |
57 | * FK to Contact ID | |
58 | * | |
59 | * @var int unsigned | |
60 | */ | |
61 | public $contact_id; | |
62 | /** | |
63 | * FK to id of the entity that the action was performed on. Pseudo - FK. | |
64 | * | |
65 | * @var int unsigned | |
66 | */ | |
67 | public $entity_id; | |
68 | /** | |
69 | * name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant | |
70 | * | |
71 | * @var string | |
72 | */ | |
73 | public $entity_table; | |
74 | /** | |
75 | * FK to the action schedule that this action originated from. | |
76 | * | |
77 | * @var int unsigned | |
78 | */ | |
79 | public $action_schedule_id; | |
80 | /** | |
81 | * date time that the action was performed on. | |
82 | * | |
83 | * @var datetime | |
84 | */ | |
85 | public $action_date_time; | |
86 | /** | |
87 | * Was there any error sending the reminder? | |
88 | * | |
89 | * @var boolean | |
90 | */ | |
91 | public $is_error; | |
92 | /** | |
93 | * Description / text in case there was an error encountered. | |
94 | * | |
95 | * @var text | |
96 | */ | |
97 | public $message; | |
98 | /** | |
99 | * Keeps track of the sequence number of this repetition. | |
100 | * | |
101 | * @var int unsigned | |
102 | */ | |
103 | public $repetition_number; | |
104 | /** | |
105 | * Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders) | |
106 | * | |
107 | * @var date | |
108 | */ | |
109 | public $reference_date; | |
110 | /** | |
111 | * class constructor | |
112 | * | |
113 | * @return civicrm_action_log | |
114 | */ | |
115 | function __construct() { | |
116 | $this->__table = 'civicrm_action_log'; | |
117 | parent::__construct(); | |
118 | } | |
119 | /** | |
120 | * Returns foreign keys and entity references | |
121 | * | |
122 | * @return array | |
123 | * [CRM_Core_Reference_Interface] | |
124 | */ | |
125 | static function getReferenceColumns() { | |
346aaaba TO |
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']); | |
e501603b | 132 | } |
346aaaba | 133 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
134 | } |
135 | /** | |
136 | * Returns all the column names of this table | |
137 | * | |
138 | * @return array | |
139 | */ | |
140 | static function &fields() { | |
346aaaba TO |
141 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
142 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
143 | 'id' => array( |
144 | 'name' => 'id', | |
145 | 'type' => CRM_Utils_Type::T_INT, | |
146 | 'title' => ts('Action Schedule ID') , | |
147 | 'required' => true, | |
148 | ) , | |
149 | 'contact_id' => array( | |
150 | 'name' => 'contact_id', | |
151 | 'type' => CRM_Utils_Type::T_INT, | |
152 | 'title' => ts('Action Schedule Contact ID') , | |
153 | 'description' => 'FK to Contact ID', | |
154 | 'FKClassName' => 'CRM_Contact_DAO_Contact', | |
155 | ) , | |
156 | 'entity_id' => array( | |
157 | 'name' => 'entity_id', | |
158 | 'type' => CRM_Utils_Type::T_INT, | |
159 | 'title' => ts('Entity ID') , | |
160 | 'description' => 'FK to id of the entity that the action was performed on. Pseudo - FK.', | |
161 | 'required' => true, | |
162 | ) , | |
163 | 'entity_table' => array( | |
164 | 'name' => 'entity_table', | |
165 | 'type' => CRM_Utils_Type::T_STRING, | |
166 | 'title' => ts('Entity Table') , | |
167 | 'description' => 'name of the entity table for the above id, e.g. civicrm_activity, civicrm_participant', | |
168 | 'maxlength' => 255, | |
169 | 'size' => CRM_Utils_Type::HUGE, | |
170 | ) , | |
171 | 'action_schedule_id' => array( | |
172 | 'name' => 'action_schedule_id', | |
173 | 'type' => CRM_Utils_Type::T_INT, | |
174 | 'title' => ts('Schedule') , | |
175 | 'description' => 'FK to the action schedule that this action originated from.', | |
176 | 'required' => true, | |
177 | 'FKClassName' => 'CRM_Core_DAO_ActionSchedule', | |
178 | ) , | |
179 | 'action_date_time' => array( | |
180 | 'name' => 'action_date_time', | |
181 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
182 | 'title' => ts('Action Date And Time') , | |
183 | 'description' => 'date time that the action was performed on.', | |
184 | ) , | |
185 | 'is_error' => array( | |
186 | 'name' => 'is_error', | |
187 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
188 | 'title' => ts('Error?') , | |
189 | 'description' => 'Was there any error sending the reminder?', | |
190 | ) , | |
191 | 'message' => array( | |
192 | 'name' => 'message', | |
193 | 'type' => CRM_Utils_Type::T_TEXT, | |
194 | 'title' => ts('Message') , | |
195 | 'description' => 'Description / text in case there was an error encountered.', | |
196 | ) , | |
197 | 'repetition_number' => array( | |
198 | 'name' => 'repetition_number', | |
199 | 'type' => CRM_Utils_Type::T_INT, | |
200 | 'title' => ts('Repetition Number') , | |
201 | 'description' => 'Keeps track of the sequence number of this repetition.', | |
202 | ) , | |
203 | 'reference_date' => array( | |
204 | 'name' => 'reference_date', | |
205 | 'type' => CRM_Utils_Type::T_DATE, | |
206 | 'title' => ts('Reference Date') , | |
207 | 'description' => 'Stores the date from the entity which triggered this reminder action (e.g. membership.end_date for most membership renewal reminders)', | |
208 | 'default' => 'NULL', | |
209 | ) , | |
210 | ); | |
346aaaba | 211 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 212 | } |
346aaaba | 213 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
214 | } |
215 | /** | |
bd8e0b14 | 216 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
217 | * |
218 | * @return array | |
bd8e0b14 | 219 | * Array(string $name => string $uniqueName). |
e501603b TO |
220 | */ |
221 | static function &fieldKeys() { | |
bd8e0b14 TO |
222 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
223 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 224 | } |
bd8e0b14 | 225 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
226 | } |
227 | /** | |
228 | * Returns the names of this table | |
229 | * | |
230 | * @return string | |
231 | */ | |
232 | static function getTableName() { | |
233 | return self::$_tableName; | |
234 | } | |
235 | /** | |
236 | * Returns if this table needs to be logged | |
237 | * | |
238 | * @return boolean | |
239 | */ | |
240 | function getLog() { | |
241 | return self::$_log; | |
242 | } | |
243 | /** | |
244 | * Returns the list of fields that can be imported | |
245 | * | |
246 | * @param bool $prefix | |
247 | * | |
248 | * @return array | |
249 | */ | |
250 | static function &import($prefix = false) { | |
60808919 TO |
251 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_log', $prefix, array()); |
252 | return $r; | |
e501603b TO |
253 | } |
254 | /** | |
255 | * Returns the list of fields that can be exported | |
256 | * | |
257 | * @param bool $prefix | |
258 | * | |
259 | * @return array | |
260 | */ | |
261 | static function &export($prefix = false) { | |
60808919 TO |
262 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_log', $prefix, array()); |
263 | return $r; | |
e501603b TO |
264 | } |
265 | } |