5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/PrintLabel.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2ff186e7860c945a080bd0d8672dee5f)
13 * Database access object for the PrintLabel entity.
15 class CRM_Core_DAO_PrintLabel
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.4';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_print_label';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * User title for this label layout
44 * (SQL type: varchar(255))
45 * Note that values will be retrieved from the database as a string.
50 * variable name/programmatic handle for this field.
53 * (SQL type: varchar(255))
54 * Note that values will be retrieved from the database as a string.
59 * Description of this label layout
63 * Note that values will be retrieved from the database as a string.
68 * This refers to name column of civicrm_option_value row in name_badge option group
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
74 public $label_format_name;
77 * Implicit FK to civicrm_option_value row in NEW label_type option group
79 * @var int|string|null
80 * (SQL type: int unsigned)
81 * Note that values will be retrieved from the database as a string.
83 public $label_type_id;
86 * contains json encode configurations options
89 * (SQL type: longtext)
90 * Note that values will be retrieved from the database as a string.
97 * @var bool|string|null
99 * Note that values will be retrieved from the database as a string.
104 * Is this option active?
106 * @var bool|string|null
107 * (SQL type: tinyint)
108 * Note that values will be retrieved from the database as a string.
113 * Is this reserved label?
115 * @var bool|string|null
116 * (SQL type: tinyint)
117 * Note that values will be retrieved from the database as a string.
122 * FK to civicrm_contact, who created this label layout
124 * @var int|string|null
125 * (SQL type: int unsigned)
126 * Note that values will be retrieved from the database as a string.
133 public function __construct() {
134 $this->__table
= 'civicrm_print_label';
135 parent
::__construct();
139 * Returns localized title of this entity.
141 * @param bool $plural
142 * Whether to return the plural version of the title.
144 public static function getEntityTitle($plural = FALSE) {
145 return $plural ?
ts('Print Labels') : ts('Print Label');
149 * Returns foreign keys and entity references.
152 * [CRM_Core_Reference_Interface]
154 public static function getReferenceColumns() {
155 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
156 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
157 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
158 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
160 return Civi
::$statics[__CLASS__
]['links'];
164 * Returns all the column names of this table
168 public static function &fields() {
169 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
170 Civi
::$statics[__CLASS__
]['fields'] = [
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Print Label ID'),
176 'where' => 'civicrm_print_label.id',
177 'table_name' => 'civicrm_print_label',
178 'entity' => 'PrintLabel',
179 'bao' => 'CRM_Core_DAO_PrintLabel',
189 'type' => CRM_Utils_Type
::T_STRING
,
190 'title' => ts('Title'),
191 'description' => ts('User title for this label layout'),
193 'size' => CRM_Utils_Type
::HUGE
,
194 'where' => 'civicrm_print_label.title',
195 'table_name' => 'civicrm_print_label',
196 'entity' => 'PrintLabel',
197 'bao' => 'CRM_Core_DAO_PrintLabel',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('Name'),
205 'description' => ts('variable name/programmatic handle for this field.'),
207 'size' => CRM_Utils_Type
::HUGE
,
208 'where' => 'civicrm_print_label.name',
209 'table_name' => 'civicrm_print_label',
210 'entity' => 'PrintLabel',
211 'bao' => 'CRM_Core_DAO_PrintLabel',
216 'name' => 'description',
217 'type' => CRM_Utils_Type
::T_TEXT
,
218 'title' => ts('Description'),
219 'description' => ts('Description of this label layout'),
220 'where' => 'civicrm_print_label.description',
221 'table_name' => 'civicrm_print_label',
222 'entity' => 'PrintLabel',
223 'bao' => 'CRM_Core_DAO_PrintLabel',
226 'label' => ts("Description"),
230 'label_format_name' => [
231 'name' => 'label_format_name',
232 'type' => CRM_Utils_Type
::T_STRING
,
233 'title' => ts('Label Format'),
234 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
236 'size' => CRM_Utils_Type
::HUGE
,
237 'where' => 'civicrm_print_label.label_format_name',
238 'table_name' => 'civicrm_print_label',
239 'entity' => 'PrintLabel',
240 'bao' => 'CRM_Core_DAO_PrintLabel',
245 'pseudoconstant' => [
246 'optionGroupName' => 'name_badge',
247 'optionEditPath' => 'civicrm/admin/options/name_badge',
252 'name' => 'label_type_id',
253 'type' => CRM_Utils_Type
::T_INT
,
254 'title' => ts('Label Type'),
255 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
256 'where' => 'civicrm_print_label.label_type_id',
257 'table_name' => 'civicrm_print_label',
258 'entity' => 'PrintLabel',
259 'bao' => 'CRM_Core_DAO_PrintLabel',
264 'pseudoconstant' => [
265 'optionGroupName' => 'label_type',
266 'optionEditPath' => 'civicrm/admin/options/label_type',
272 'type' => CRM_Utils_Type
::T_LONGTEXT
,
273 'title' => ts('Data'),
274 'description' => ts('contains json encode configurations options'),
275 'where' => 'civicrm_print_label.data',
276 'table_name' => 'civicrm_print_label',
277 'entity' => 'PrintLabel',
278 'bao' => 'CRM_Core_DAO_PrintLabel',
280 'serialize' => self
::SERIALIZE_JSON
,
282 'label' => ts("Data"),
287 'name' => 'is_default',
288 'type' => CRM_Utils_Type
::T_BOOLEAN
,
289 'title' => ts('Label is Default?'),
290 'description' => ts('Is this default?'),
291 'where' => 'civicrm_print_label.is_default',
293 'table_name' => 'civicrm_print_label',
294 'entity' => 'PrintLabel',
295 'bao' => 'CRM_Core_DAO_PrintLabel',
300 'name' => 'is_active',
301 'type' => CRM_Utils_Type
::T_BOOLEAN
,
302 'title' => ts('Label Is Active?'),
303 'description' => ts('Is this option active?'),
304 'where' => 'civicrm_print_label.is_active',
306 'table_name' => 'civicrm_print_label',
307 'entity' => 'PrintLabel',
308 'bao' => 'CRM_Core_DAO_PrintLabel',
313 'name' => 'is_reserved',
314 'type' => CRM_Utils_Type
::T_BOOLEAN
,
315 'title' => ts('Is Label Reserved?'),
316 'description' => ts('Is this reserved label?'),
317 'where' => 'civicrm_print_label.is_reserved',
319 'table_name' => 'civicrm_print_label',
320 'entity' => 'PrintLabel',
321 'bao' => 'CRM_Core_DAO_PrintLabel',
326 'name' => 'created_id',
327 'type' => CRM_Utils_Type
::T_INT
,
328 'title' => ts('Created By Contact ID'),
329 'description' => ts('FK to civicrm_contact, who created this label layout'),
330 'where' => 'civicrm_print_label.created_id',
331 'table_name' => 'civicrm_print_label',
332 'entity' => 'PrintLabel',
333 'bao' => 'CRM_Core_DAO_PrintLabel',
335 'FKClassName' => 'CRM_Contact_DAO_Contact',
337 'label' => ts("Created By"),
342 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
344 return Civi
::$statics[__CLASS__
]['fields'];
348 * Return a mapping from field-name to the corresponding key (as used in fields()).
351 * Array(string $name => string $uniqueName).
353 public static function &fieldKeys() {
354 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
355 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
357 return Civi
::$statics[__CLASS__
]['fieldKeys'];
361 * Returns the names of this table
365 public static function getTableName() {
366 return self
::$_tableName;
370 * Returns if this table needs to be logged
374 public function getLog() {
379 * Returns the list of fields that can be imported
381 * @param bool $prefix
385 public static function &import($prefix = FALSE) {
386 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
391 * Returns the list of fields that can be exported
393 * @param bool $prefix
397 public static function &export($prefix = FALSE) {
398 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
403 * Returns the list of indices
405 * @param bool $localize
409 public static function indices($localize = TRUE) {
411 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;