Merge pull request #15323 from elisseck/dev/core/1266
[civicrm-core.git] / CRM / Core / DAO / ActionMapping.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/ActionMapping.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4642b2b6da658a34c8dda7c46a93e059)
10 */
11
12 /**
13 * Database access object for the ActionMapping entity.
14 */
15 class CRM_Core_DAO_ActionMapping extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_action_mapping';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * @var int
33 */
34 public $id;
35
36 /**
37 * Entity for which the reminder is created
38 *
39 * @var string
40 */
41 public $entity;
42
43 /**
44 * Entity value
45 *
46 * @var string
47 */
48 public $entity_value;
49
50 /**
51 * Entity value label
52 *
53 * @var string
54 */
55 public $entity_value_label;
56
57 /**
58 * Entity status
59 *
60 * @var string
61 */
62 public $entity_status;
63
64 /**
65 * Entity status label
66 *
67 * @var string
68 */
69 public $entity_status_label;
70
71 /**
72 * Entity date
73 *
74 * @var string
75 */
76 public $entity_date_start;
77
78 /**
79 * Entity date
80 *
81 * @var string
82 */
83 public $entity_date_end;
84
85 /**
86 * Entity recipient
87 *
88 * @var string
89 */
90 public $entity_recipient;
91
92 /**
93 * Class constructor.
94 */
95 public function __construct() {
96 $this->__table = 'civicrm_action_mapping';
97 parent::__construct();
98 }
99
100 /**
101 * Returns all the column names of this table
102 *
103 * @return array
104 */
105 public static function &fields() {
106 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
107 Civi::$statics[__CLASS__]['fields'] = [
108 'id' => [
109 'name' => 'id',
110 'type' => CRM_Utils_Type::T_INT,
111 'title' => ts('Action Mapping ID'),
112 'required' => TRUE,
113 'where' => 'civicrm_action_mapping.id',
114 'table_name' => 'civicrm_action_mapping',
115 'entity' => 'ActionMapping',
116 'bao' => 'CRM_Core_DAO_ActionMapping',
117 'localizable' => 0,
118 ],
119 'entity' => [
120 'name' => 'entity',
121 'type' => CRM_Utils_Type::T_STRING,
122 'title' => ts('Action Mapping Entity'),
123 'description' => ts('Entity for which the reminder is created'),
124 'maxlength' => 64,
125 'size' => CRM_Utils_Type::BIG,
126 'where' => 'civicrm_action_mapping.entity',
127 'table_name' => 'civicrm_action_mapping',
128 'entity' => 'ActionMapping',
129 'bao' => 'CRM_Core_DAO_ActionMapping',
130 'localizable' => 0,
131 ],
132 'entity_value' => [
133 'name' => 'entity_value',
134 'type' => CRM_Utils_Type::T_STRING,
135 'title' => ts('Action Mapping Entity Value'),
136 'description' => ts('Entity value'),
137 'maxlength' => 64,
138 'size' => CRM_Utils_Type::BIG,
139 'where' => 'civicrm_action_mapping.entity_value',
140 'table_name' => 'civicrm_action_mapping',
141 'entity' => 'ActionMapping',
142 'bao' => 'CRM_Core_DAO_ActionMapping',
143 'localizable' => 0,
144 ],
145 'entity_value_label' => [
146 'name' => 'entity_value_label',
147 'type' => CRM_Utils_Type::T_STRING,
148 'title' => ts('Value Label'),
149 'description' => ts('Entity value label'),
150 'maxlength' => 64,
151 'size' => CRM_Utils_Type::BIG,
152 'where' => 'civicrm_action_mapping.entity_value_label',
153 'table_name' => 'civicrm_action_mapping',
154 'entity' => 'ActionMapping',
155 'bao' => 'CRM_Core_DAO_ActionMapping',
156 'localizable' => 0,
157 ],
158 'entity_status' => [
159 'name' => 'entity_status',
160 'type' => CRM_Utils_Type::T_STRING,
161 'title' => ts('Status'),
162 'description' => ts('Entity status'),
163 'maxlength' => 64,
164 'size' => CRM_Utils_Type::BIG,
165 'where' => 'civicrm_action_mapping.entity_status',
166 'table_name' => 'civicrm_action_mapping',
167 'entity' => 'ActionMapping',
168 'bao' => 'CRM_Core_DAO_ActionMapping',
169 'localizable' => 0,
170 ],
171 'entity_status_label' => [
172 'name' => 'entity_status_label',
173 'type' => CRM_Utils_Type::T_STRING,
174 'title' => ts('Status Label'),
175 'description' => ts('Entity status label'),
176 'maxlength' => 64,
177 'size' => CRM_Utils_Type::BIG,
178 'where' => 'civicrm_action_mapping.entity_status_label',
179 'table_name' => 'civicrm_action_mapping',
180 'entity' => 'ActionMapping',
181 'bao' => 'CRM_Core_DAO_ActionMapping',
182 'localizable' => 0,
183 ],
184 'entity_date_start' => [
185 'name' => 'entity_date_start',
186 'type' => CRM_Utils_Type::T_STRING,
187 'title' => ts('Entity Start Date'),
188 'description' => ts('Entity date'),
189 'maxlength' => 64,
190 'size' => CRM_Utils_Type::BIG,
191 'where' => 'civicrm_action_mapping.entity_date_start',
192 'table_name' => 'civicrm_action_mapping',
193 'entity' => 'ActionMapping',
194 'bao' => 'CRM_Core_DAO_ActionMapping',
195 'localizable' => 0,
196 ],
197 'entity_date_end' => [
198 'name' => 'entity_date_end',
199 'type' => CRM_Utils_Type::T_STRING,
200 'title' => ts('Entity End Date'),
201 'description' => ts('Entity date'),
202 'maxlength' => 64,
203 'size' => CRM_Utils_Type::BIG,
204 'where' => 'civicrm_action_mapping.entity_date_end',
205 'table_name' => 'civicrm_action_mapping',
206 'entity' => 'ActionMapping',
207 'bao' => 'CRM_Core_DAO_ActionMapping',
208 'localizable' => 0,
209 ],
210 'entity_recipient' => [
211 'name' => 'entity_recipient',
212 'type' => CRM_Utils_Type::T_STRING,
213 'title' => ts('Entity Recipient'),
214 'description' => ts('Entity recipient'),
215 'maxlength' => 64,
216 'size' => CRM_Utils_Type::BIG,
217 'where' => 'civicrm_action_mapping.entity_recipient',
218 'table_name' => 'civicrm_action_mapping',
219 'entity' => 'ActionMapping',
220 'bao' => 'CRM_Core_DAO_ActionMapping',
221 'localizable' => 0,
222 ],
223 ];
224 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
225 }
226 return Civi::$statics[__CLASS__]['fields'];
227 }
228
229 /**
230 * Return a mapping from field-name to the corresponding key (as used in fields()).
231 *
232 * @return array
233 * Array(string $name => string $uniqueName).
234 */
235 public static function &fieldKeys() {
236 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
237 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
238 }
239 return Civi::$statics[__CLASS__]['fieldKeys'];
240 }
241
242 /**
243 * Returns the names of this table
244 *
245 * @return string
246 */
247 public static function getTableName() {
248 return self::$_tableName;
249 }
250
251 /**
252 * Returns if this table needs to be logged
253 *
254 * @return bool
255 */
256 public function getLog() {
257 return self::$_log;
258 }
259
260 /**
261 * Returns the list of fields that can be imported
262 *
263 * @param bool $prefix
264 *
265 * @return array
266 */
267 public static function &import($prefix = FALSE) {
268 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_mapping', $prefix, []);
269 return $r;
270 }
271
272 /**
273 * Returns the list of fields that can be exported
274 *
275 * @param bool $prefix
276 *
277 * @return array
278 */
279 public static function &export($prefix = FALSE) {
280 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_mapping', $prefix, []);
281 return $r;
282 }
283
284 /**
285 * Returns the list of indices
286 *
287 * @param bool $localize
288 *
289 * @return array
290 */
291 public static function indices($localize = TRUE) {
292 $indices = [];
293 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
294 }
295
296 }