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