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:55db87fdd43d6037d64da10df24fc2b8)
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.
99 * Note that values will be retrieved from the database as a string.
104 * Is this option active?
107 * (SQL type: tinyint)
108 * Note that values will be retrieved from the database as a string.
113 * Is this reserved label?
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?'),
292 'where' => 'civicrm_print_label.is_default',
294 'table_name' => 'civicrm_print_label',
295 'entity' => 'PrintLabel',
296 'bao' => 'CRM_Core_DAO_PrintLabel',
301 'name' => 'is_active',
302 'type' => CRM_Utils_Type
::T_BOOLEAN
,
303 'title' => ts('Label Is Active?'),
304 'description' => ts('Is this option active?'),
306 'where' => 'civicrm_print_label.is_active',
308 'table_name' => 'civicrm_print_label',
309 'entity' => 'PrintLabel',
310 'bao' => 'CRM_Core_DAO_PrintLabel',
315 'name' => 'is_reserved',
316 'type' => CRM_Utils_Type
::T_BOOLEAN
,
317 'title' => ts('Is Label Reserved?'),
318 'description' => ts('Is this reserved label?'),
320 'where' => 'civicrm_print_label.is_reserved',
322 'table_name' => 'civicrm_print_label',
323 'entity' => 'PrintLabel',
324 'bao' => 'CRM_Core_DAO_PrintLabel',
329 'name' => 'created_id',
330 'type' => CRM_Utils_Type
::T_INT
,
331 'title' => ts('Created By Contact ID'),
332 'description' => ts('FK to civicrm_contact, who created this label layout'),
333 'where' => 'civicrm_print_label.created_id',
334 'table_name' => 'civicrm_print_label',
335 'entity' => 'PrintLabel',
336 'bao' => 'CRM_Core_DAO_PrintLabel',
338 'FKClassName' => 'CRM_Contact_DAO_Contact',
340 'label' => ts("Created By"),
345 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
347 return Civi
::$statics[__CLASS__
]['fields'];
351 * Return a mapping from field-name to the corresponding key (as used in fields()).
354 * Array(string $name => string $uniqueName).
356 public static function &fieldKeys() {
357 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
358 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
360 return Civi
::$statics[__CLASS__
]['fieldKeys'];
364 * Returns the names of this table
368 public static function getTableName() {
369 return self
::$_tableName;
373 * Returns if this table needs to be logged
377 public function getLog() {
382 * Returns the list of fields that can be imported
384 * @param bool $prefix
388 public static function &import($prefix = FALSE) {
389 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
394 * Returns the list of fields that can be exported
396 * @param bool $prefix
400 public static function &export($prefix = FALSE) {
401 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
406 * Returns the list of indices
408 * @param bool $localize
412 public static function indices($localize = TRUE) {
414 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;