Update dao.tpl to not make presence of import or export required to add 'where' param
[civicrm-core.git] / CRM / Core / DAO / PrintLabel.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/PrintLabel.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e380ee3b 9 * (GenCodeChecksum:ca56833ea757bf1363d618add294960d)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the PrintLabel entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
fa45b5b9 22 public static $_tableName = 'civicrm_print_label';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 30
e501603b 31 /**
e501603b
TO
32 * @var int unsigned
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * User title for for this label layout
38 *
39 * @var string
40 */
41 public $title;
c3fc2621 42
e501603b
TO
43 /**
44 * variable name/programmatic handle for this field.
45 *
46 * @var string
47 */
48 public $name;
c3fc2621 49
e501603b
TO
50 /**
51 * Description of this label layout
52 *
53 * @var text
54 */
55 public $description;
c3fc2621 56
e501603b
TO
57 /**
58 * This refers to name column of civicrm_option_value row in name_badge option group
59 *
60 * @var string
61 */
62 public $label_format_name;
c3fc2621 63
e501603b
TO
64 /**
65 * Implicit FK to civicrm_option_value row in NEW label_type option group
66 *
67 * @var int unsigned
68 */
69 public $label_type_id;
c3fc2621 70
e501603b
TO
71 /**
72 * contains json encode configurations options
73 *
74 * @var longtext
75 */
76 public $data;
c3fc2621 77
e501603b
TO
78 /**
79 * Is this default?
80 *
81 * @var boolean
82 */
83 public $is_default;
c3fc2621 84
e501603b
TO
85 /**
86 * Is this option active?
87 *
88 * @var boolean
89 */
90 public $is_active;
c3fc2621 91
e501603b
TO
92 /**
93 * Is this reserved label?
94 *
95 * @var boolean
96 */
97 public $is_reserved;
c3fc2621 98
e501603b
TO
99 /**
100 * FK to civicrm_contact, who created this label layout
101 *
102 * @var int unsigned
103 */
104 public $created_id;
c3fc2621 105
e501603b 106 /**
f41f0342 107 * Class constructor.
e501603b 108 */
c3fc2621 109 public function __construct() {
e501603b
TO
110 $this->__table = 'civicrm_print_label';
111 parent::__construct();
112 }
c3fc2621 113
e501603b 114 /**
f41f0342 115 * Returns foreign keys and entity references.
e501603b
TO
116 *
117 * @return array
118 * [CRM_Core_Reference_Interface]
119 */
c3fc2621 120 public static function getReferenceColumns() {
346aaaba 121 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 122 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 123 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
346aaaba 124 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 125 }
346aaaba 126 return Civi::$statics[__CLASS__]['links'];
e501603b 127 }
c3fc2621 128
e501603b
TO
129 /**
130 * Returns all the column names of this table
131 *
132 * @return array
133 */
c3fc2621 134 public static function &fields() {
346aaaba 135 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
136 Civi::$statics[__CLASS__]['fields'] = [
137 'id' => [
e501603b
TO
138 'name' => 'id',
139 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
140 'title' => ts('Print Label ID'),
141 'required' => TRUE,
522a26c9 142 'table_name' => 'civicrm_print_label',
143 'entity' => 'PrintLabel',
144 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 145 'localizable' => 0,
c3fc2621
CW
146 ],
147 'title' => [
e501603b
TO
148 'name' => 'title',
149 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 150 'title' => ts('Title'),
215b423e 151 'description' => ts('User title for for this label layout'),
e501603b
TO
152 'maxlength' => 255,
153 'size' => CRM_Utils_Type::HUGE,
522a26c9 154 'table_name' => 'civicrm_print_label',
155 'entity' => 'PrintLabel',
156 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 157 'localizable' => 0,
c3fc2621
CW
158 ],
159 'name' => [
e501603b
TO
160 'name' => 'name',
161 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 162 'title' => ts('Name'),
215b423e 163 'description' => ts('variable name/programmatic handle for this field.'),
e501603b
TO
164 'maxlength' => 255,
165 'size' => CRM_Utils_Type::HUGE,
522a26c9 166 'table_name' => 'civicrm_print_label',
167 'entity' => 'PrintLabel',
168 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 169 'localizable' => 0,
c3fc2621
CW
170 ],
171 'description' => [
e501603b
TO
172 'name' => 'description',
173 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 174 'title' => ts('Description'),
215b423e 175 'description' => ts('Description of this label layout'),
522a26c9 176 'table_name' => 'civicrm_print_label',
177 'entity' => 'PrintLabel',
178 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 179 'localizable' => 0,
c3fc2621
CW
180 ],
181 'label_format_name' => [
e501603b
TO
182 'name' => 'label_format_name',
183 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 184 'title' => ts('Label Format'),
215b423e 185 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
e501603b
TO
186 'maxlength' => 255,
187 'size' => CRM_Utils_Type::HUGE,
522a26c9 188 'table_name' => 'civicrm_print_label',
189 'entity' => 'PrintLabel',
190 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 191 'localizable' => 0,
c3fc2621 192 'html' => [
e501603b 193 'type' => 'Select',
c3fc2621
CW
194 ],
195 'pseudoconstant' => [
e501603b
TO
196 'optionGroupName' => 'name_badge',
197 'optionEditPath' => 'civicrm/admin/options/name_badge',
c3fc2621
CW
198 ]
199 ],
200 'label_type_id' => [
e501603b
TO
201 'name' => 'label_type_id',
202 'type' => CRM_Utils_Type::T_INT,
c3fc2621 203 'title' => ts('Label Type'),
215b423e 204 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
522a26c9 205 'table_name' => 'civicrm_print_label',
206 'entity' => 'PrintLabel',
207 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 208 'localizable' => 0,
c3fc2621 209 'html' => [
e501603b 210 'type' => 'Select',
c3fc2621
CW
211 ],
212 'pseudoconstant' => [
e501603b
TO
213 'optionGroupName' => 'label_type',
214 'optionEditPath' => 'civicrm/admin/options/label_type',
c3fc2621
CW
215 ]
216 ],
217 'data' => [
e501603b
TO
218 'name' => 'data',
219 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 220 'title' => ts('Data'),
215b423e 221 'description' => ts('contains json encode configurations options'),
522a26c9 222 'table_name' => 'civicrm_print_label',
223 'entity' => 'PrintLabel',
224 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 225 'localizable' => 0,
2a5c9b4d 226 'serialize' => self::SERIALIZE_JSON,
c3fc2621
CW
227 ],
228 'is_default' => [
e501603b
TO
229 'name' => 'is_default',
230 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 231 'title' => ts('Label is Default?'),
215b423e 232 'description' => ts('Is this default?'),
e501603b 233 'default' => '1',
522a26c9 234 'table_name' => 'civicrm_print_label',
235 'entity' => 'PrintLabel',
236 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 237 'localizable' => 0,
c3fc2621
CW
238 ],
239 'is_active' => [
e501603b
TO
240 'name' => 'is_active',
241 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 242 'title' => ts('Label Is Active?'),
215b423e 243 'description' => ts('Is this option active?'),
e501603b 244 'default' => '1',
522a26c9 245 'table_name' => 'civicrm_print_label',
246 'entity' => 'PrintLabel',
247 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 248 'localizable' => 0,
c3fc2621
CW
249 ],
250 'is_reserved' => [
e501603b
TO
251 'name' => 'is_reserved',
252 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 253 'title' => ts('Is Label Reserved?'),
215b423e 254 'description' => ts('Is this reserved label?'),
e501603b 255 'default' => '1',
522a26c9 256 'table_name' => 'civicrm_print_label',
257 'entity' => 'PrintLabel',
258 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 259 'localizable' => 0,
c3fc2621
CW
260 ],
261 'created_id' => [
e501603b
TO
262 'name' => 'created_id',
263 'type' => CRM_Utils_Type::T_INT,
c3fc2621 264 'title' => ts('Label Created By'),
215b423e 265 'description' => ts('FK to civicrm_contact, who created this label layout'),
522a26c9 266 'table_name' => 'civicrm_print_label',
267 'entity' => 'PrintLabel',
268 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 269 'localizable' => 0,
e501603b 270 'FKClassName' => 'CRM_Contact_DAO_Contact',
c3fc2621
CW
271 ],
272 ];
346aaaba 273 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 274 }
346aaaba 275 return Civi::$statics[__CLASS__]['fields'];
e501603b 276 }
c3fc2621 277
e501603b 278 /**
bd8e0b14 279 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
280 *
281 * @return array
bd8e0b14 282 * Array(string $name => string $uniqueName).
e501603b 283 */
c3fc2621 284 public static function &fieldKeys() {
bd8e0b14
TO
285 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
286 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 287 }
bd8e0b14 288 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 289 }
c3fc2621 290
e501603b
TO
291 /**
292 * Returns the names of this table
293 *
294 * @return string
295 */
c3fc2621 296 public static function getTableName() {
e501603b
TO
297 return self::$_tableName;
298 }
c3fc2621 299
e501603b
TO
300 /**
301 * Returns if this table needs to be logged
302 *
c3fc2621 303 * @return bool
e501603b 304 */
c3fc2621 305 public function getLog() {
e501603b
TO
306 return self::$_log;
307 }
c3fc2621 308
e501603b
TO
309 /**
310 * Returns the list of fields that can be imported
311 *
312 * @param bool $prefix
313 *
314 * @return array
315 */
c3fc2621
CW
316 public static function &import($prefix = FALSE) {
317 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, []);
60808919 318 return $r;
e501603b 319 }
c3fc2621 320
e501603b
TO
321 /**
322 * Returns the list of fields that can be exported
323 *
324 * @param bool $prefix
325 *
326 * @return array
327 */
c3fc2621
CW
328 public static function &export($prefix = FALSE) {
329 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, []);
60808919 330 return $r;
e501603b 331 }
c3fc2621 332
e7a6b91a
AS
333 /**
334 * Returns the list of indices
c3fc2621
CW
335 *
336 * @param bool $localize
337 *
338 * @return array
e7a6b91a
AS
339 */
340 public static function indices($localize = TRUE) {
c3fc2621 341 $indices = [];
e7a6b91a
AS
342 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
343 }
c3fc2621 344
e501603b 345}