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