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:484a16ebc1b881e7718bfcf139024ee7)
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 public static function getEntityTitle() {
120 return ts('Print Labels');
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 public static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
135 return Civi
::$statics[__CLASS__
]['links'];
139 * Returns all the column names of this table
143 public static function &fields() {
144 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
145 Civi
::$statics[__CLASS__
]['fields'] = [
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Print Label ID'),
151 'where' => 'civicrm_print_label.id',
152 'table_name' => 'civicrm_print_label',
153 'entity' => 'PrintLabel',
154 'bao' => 'CRM_Core_DAO_PrintLabel',
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'title' => ts('Title'),
162 'description' => ts('User title for this label layout'),
164 'size' => CRM_Utils_Type
::HUGE
,
165 'where' => 'civicrm_print_label.title',
166 'table_name' => 'civicrm_print_label',
167 'entity' => 'PrintLabel',
168 'bao' => 'CRM_Core_DAO_PrintLabel',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Name'),
176 'description' => ts('variable name/programmatic handle for this field.'),
178 'size' => CRM_Utils_Type
::HUGE
,
179 'where' => 'civicrm_print_label.name',
180 'table_name' => 'civicrm_print_label',
181 'entity' => 'PrintLabel',
182 'bao' => 'CRM_Core_DAO_PrintLabel',
187 'name' => 'description',
188 'type' => CRM_Utils_Type
::T_TEXT
,
189 'title' => ts('Description'),
190 'description' => ts('Description of this label layout'),
191 'where' => 'civicrm_print_label.description',
192 'table_name' => 'civicrm_print_label',
193 'entity' => 'PrintLabel',
194 'bao' => 'CRM_Core_DAO_PrintLabel',
198 'label_format_name' => [
199 'name' => 'label_format_name',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('Label Format'),
202 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
204 'size' => CRM_Utils_Type
::HUGE
,
205 'where' => 'civicrm_print_label.label_format_name',
206 'table_name' => 'civicrm_print_label',
207 'entity' => 'PrintLabel',
208 'bao' => 'CRM_Core_DAO_PrintLabel',
213 'pseudoconstant' => [
214 'optionGroupName' => 'name_badge',
215 'optionEditPath' => 'civicrm/admin/options/name_badge',
220 'name' => 'label_type_id',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Label Type'),
223 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
224 'where' => 'civicrm_print_label.label_type_id',
225 'table_name' => 'civicrm_print_label',
226 'entity' => 'PrintLabel',
227 'bao' => 'CRM_Core_DAO_PrintLabel',
232 'pseudoconstant' => [
233 'optionGroupName' => 'label_type',
234 'optionEditPath' => 'civicrm/admin/options/label_type',
240 'type' => CRM_Utils_Type
::T_LONGTEXT
,
241 'title' => ts('Data'),
242 'description' => ts('contains json encode configurations options'),
243 'where' => 'civicrm_print_label.data',
244 'table_name' => 'civicrm_print_label',
245 'entity' => 'PrintLabel',
246 'bao' => 'CRM_Core_DAO_PrintLabel',
248 'serialize' => self
::SERIALIZE_JSON
,
252 'name' => 'is_default',
253 'type' => CRM_Utils_Type
::T_BOOLEAN
,
254 'title' => ts('Label is Default?'),
255 'description' => ts('Is this default?'),
256 'where' => 'civicrm_print_label.is_default',
258 'table_name' => 'civicrm_print_label',
259 'entity' => 'PrintLabel',
260 'bao' => 'CRM_Core_DAO_PrintLabel',
265 'name' => 'is_active',
266 'type' => CRM_Utils_Type
::T_BOOLEAN
,
267 'title' => ts('Label Is Active?'),
268 'description' => ts('Is this option active?'),
269 'where' => 'civicrm_print_label.is_active',
271 'table_name' => 'civicrm_print_label',
272 'entity' => 'PrintLabel',
273 'bao' => 'CRM_Core_DAO_PrintLabel',
278 'name' => 'is_reserved',
279 'type' => CRM_Utils_Type
::T_BOOLEAN
,
280 'title' => ts('Is Label Reserved?'),
281 'description' => ts('Is this reserved label?'),
282 'where' => 'civicrm_print_label.is_reserved',
284 'table_name' => 'civicrm_print_label',
285 'entity' => 'PrintLabel',
286 'bao' => 'CRM_Core_DAO_PrintLabel',
291 'name' => 'created_id',
292 'type' => CRM_Utils_Type
::T_INT
,
293 'title' => ts('Label Created By'),
294 'description' => ts('FK to civicrm_contact, who created this label layout'),
295 'where' => 'civicrm_print_label.created_id',
296 'table_name' => 'civicrm_print_label',
297 'entity' => 'PrintLabel',
298 'bao' => 'CRM_Core_DAO_PrintLabel',
300 'FKClassName' => 'CRM_Contact_DAO_Contact',
304 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
306 return Civi
::$statics[__CLASS__
]['fields'];
310 * Return a mapping from field-name to the corresponding key (as used in fields()).
313 * Array(string $name => string $uniqueName).
315 public static function &fieldKeys() {
316 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
317 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
319 return Civi
::$statics[__CLASS__
]['fieldKeys'];
323 * Returns the names of this table
327 public static function getTableName() {
328 return self
::$_tableName;
332 * Returns if this table needs to be logged
336 public function getLog() {
341 * Returns the list of fields that can be imported
343 * @param bool $prefix
347 public static function &import($prefix = FALSE) {
348 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
353 * Returns the list of fields that can be exported
355 * @param bool $prefix
359 public static function &export($prefix = FALSE) {
360 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
365 * Returns the list of indices
367 * @param bool $localize
371 public static function indices($localize = TRUE) {
373 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;