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:29063fe048df3c056de7bd26c959ff16)
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;
39 * User title for this label layout
46 * variable name/programmatic handle for this field.
53 * Description of this label layout
60 * This refers to name column of civicrm_option_value row in name_badge option group
64 public $label_format_name;
67 * Implicit FK to civicrm_option_value row in NEW label_type option group
71 public $label_type_id;
74 * contains json encode configurations options
88 * Is this option active?
95 * Is this reserved label?
102 * FK to civicrm_contact, who created this label layout
111 public function __construct() {
112 $this->__table
= 'civicrm_print_label';
113 parent
::__construct();
117 * Returns localized title of this entity.
119 * @param bool $plural
120 * Whether to return the plural version of the title.
122 public static function getEntityTitle($plural = FALSE) {
123 return $plural ?
ts('Print Labels') : ts('Print Label');
127 * Returns foreign keys and entity references.
130 * [CRM_Core_Reference_Interface]
132 public static function getReferenceColumns() {
133 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
134 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
135 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
136 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
138 return Civi
::$statics[__CLASS__
]['links'];
142 * Returns all the column names of this table
146 public static function &fields() {
147 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
148 Civi
::$statics[__CLASS__
]['fields'] = [
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Print Label ID'),
154 'where' => 'civicrm_print_label.id',
155 'table_name' => 'civicrm_print_label',
156 'entity' => 'PrintLabel',
157 'bao' => 'CRM_Core_DAO_PrintLabel',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Title'),
169 'description' => ts('User title for this label layout'),
171 'size' => CRM_Utils_Type
::HUGE
,
172 'where' => 'civicrm_print_label.title',
173 'table_name' => 'civicrm_print_label',
174 'entity' => 'PrintLabel',
175 'bao' => 'CRM_Core_DAO_PrintLabel',
181 'type' => CRM_Utils_Type
::T_STRING
,
182 'title' => ts('Name'),
183 'description' => ts('variable name/programmatic handle for this field.'),
185 'size' => CRM_Utils_Type
::HUGE
,
186 'where' => 'civicrm_print_label.name',
187 'table_name' => 'civicrm_print_label',
188 'entity' => 'PrintLabel',
189 'bao' => 'CRM_Core_DAO_PrintLabel',
194 'name' => 'description',
195 'type' => CRM_Utils_Type
::T_TEXT
,
196 'title' => ts('Description'),
197 'description' => ts('Description of this label layout'),
198 'where' => 'civicrm_print_label.description',
199 'table_name' => 'civicrm_print_label',
200 'entity' => 'PrintLabel',
201 'bao' => 'CRM_Core_DAO_PrintLabel',
204 'label' => ts("Description"),
208 'label_format_name' => [
209 'name' => 'label_format_name',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Label Format'),
212 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
214 'size' => CRM_Utils_Type
::HUGE
,
215 'where' => 'civicrm_print_label.label_format_name',
216 'table_name' => 'civicrm_print_label',
217 'entity' => 'PrintLabel',
218 'bao' => 'CRM_Core_DAO_PrintLabel',
223 'pseudoconstant' => [
224 'optionGroupName' => 'name_badge',
225 'optionEditPath' => 'civicrm/admin/options/name_badge',
230 'name' => 'label_type_id',
231 'type' => CRM_Utils_Type
::T_INT
,
232 'title' => ts('Label Type'),
233 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
234 'where' => 'civicrm_print_label.label_type_id',
235 'table_name' => 'civicrm_print_label',
236 'entity' => 'PrintLabel',
237 'bao' => 'CRM_Core_DAO_PrintLabel',
242 'pseudoconstant' => [
243 'optionGroupName' => 'label_type',
244 'optionEditPath' => 'civicrm/admin/options/label_type',
250 'type' => CRM_Utils_Type
::T_LONGTEXT
,
251 'title' => ts('Data'),
252 'description' => ts('contains json encode configurations options'),
253 'where' => 'civicrm_print_label.data',
254 'table_name' => 'civicrm_print_label',
255 'entity' => 'PrintLabel',
256 'bao' => 'CRM_Core_DAO_PrintLabel',
258 'serialize' => self
::SERIALIZE_JSON
,
260 'label' => ts("Data"),
265 'name' => 'is_default',
266 'type' => CRM_Utils_Type
::T_BOOLEAN
,
267 'title' => ts('Label is Default?'),
268 'description' => ts('Is this default?'),
269 'where' => 'civicrm_print_label.is_default',
271 'table_name' => 'civicrm_print_label',
272 'entity' => 'PrintLabel',
273 'bao' => 'CRM_Core_DAO_PrintLabel',
278 'name' => 'is_active',
279 'type' => CRM_Utils_Type
::T_BOOLEAN
,
280 'title' => ts('Label Is Active?'),
281 'description' => ts('Is this option active?'),
282 'where' => 'civicrm_print_label.is_active',
284 'table_name' => 'civicrm_print_label',
285 'entity' => 'PrintLabel',
286 'bao' => 'CRM_Core_DAO_PrintLabel',
291 'name' => 'is_reserved',
292 'type' => CRM_Utils_Type
::T_BOOLEAN
,
293 'title' => ts('Is Label Reserved?'),
294 'description' => ts('Is this reserved label?'),
295 'where' => 'civicrm_print_label.is_reserved',
297 'table_name' => 'civicrm_print_label',
298 'entity' => 'PrintLabel',
299 'bao' => 'CRM_Core_DAO_PrintLabel',
304 'name' => 'created_id',
305 'type' => CRM_Utils_Type
::T_INT
,
306 'title' => ts('Created By Contact ID'),
307 'description' => ts('FK to civicrm_contact, who created this label layout'),
308 'where' => 'civicrm_print_label.created_id',
309 'table_name' => 'civicrm_print_label',
310 'entity' => 'PrintLabel',
311 'bao' => 'CRM_Core_DAO_PrintLabel',
313 'FKClassName' => 'CRM_Contact_DAO_Contact',
315 'label' => ts("Created By"),
320 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
322 return Civi
::$statics[__CLASS__
]['fields'];
326 * Return a mapping from field-name to the corresponding key (as used in fields()).
329 * Array(string $name => string $uniqueName).
331 public static function &fieldKeys() {
332 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
333 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
335 return Civi
::$statics[__CLASS__
]['fieldKeys'];
339 * Returns the names of this table
343 public static function getTableName() {
344 return self
::$_tableName;
348 * Returns if this table needs to be logged
352 public function getLog() {
357 * Returns the list of fields that can be imported
359 * @param bool $prefix
363 public static function &import($prefix = FALSE) {
364 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
369 * Returns the list of fields that can be exported
371 * @param bool $prefix
375 public static function &export($prefix = FALSE) {
376 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
381 * Returns the list of indices
383 * @param bool $localize
387 public static function indices($localize = TRUE) {
389 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;