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:b98543c0a9d27b4f6aef0ab432bb37e2)
13 * Database access object for the PrintLabel entity.
15 class CRM_Core_DAO_PrintLabel
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_print_label';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * User title for this label layout
44 * variable name/programmatic handle for this field.
51 * Description of this label layout
58 * This refers to name column of civicrm_option_value row in name_badge option group
62 public $label_format_name;
65 * Implicit FK to civicrm_option_value row in NEW label_type option group
69 public $label_type_id;
72 * contains json encode configurations options
86 * Is this option active?
93 * Is this reserved label?
100 * FK to civicrm_contact, who created this label layout
109 public function __construct() {
110 $this->__table
= 'civicrm_print_label';
111 parent
::__construct();
115 * Returns localized title of this entity.
117 public static function getEntityTitle() {
118 return ts('Print Labels');
122 * Returns foreign keys and entity references.
125 * [CRM_Core_Reference_Interface]
127 public static function getReferenceColumns() {
128 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
129 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
130 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
133 return Civi
::$statics[__CLASS__
]['links'];
137 * Returns all the column names of this table
141 public static function &fields() {
142 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
143 Civi
::$statics[__CLASS__
]['fields'] = [
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Print Label ID'),
149 'where' => 'civicrm_print_label.id',
150 'table_name' => 'civicrm_print_label',
151 'entity' => 'PrintLabel',
152 'bao' => 'CRM_Core_DAO_PrintLabel',
158 'type' => CRM_Utils_Type
::T_STRING
,
159 'title' => ts('Title'),
160 'description' => ts('User title for this label layout'),
162 'size' => CRM_Utils_Type
::HUGE
,
163 'where' => 'civicrm_print_label.title',
164 'table_name' => 'civicrm_print_label',
165 'entity' => 'PrintLabel',
166 'bao' => 'CRM_Core_DAO_PrintLabel',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Name'),
174 'description' => ts('variable name/programmatic handle for this field.'),
176 'size' => CRM_Utils_Type
::HUGE
,
177 'where' => 'civicrm_print_label.name',
178 'table_name' => 'civicrm_print_label',
179 'entity' => 'PrintLabel',
180 'bao' => 'CRM_Core_DAO_PrintLabel',
185 'name' => 'description',
186 'type' => CRM_Utils_Type
::T_TEXT
,
187 'title' => ts('Description'),
188 'description' => ts('Description of this label layout'),
189 'where' => 'civicrm_print_label.description',
190 'table_name' => 'civicrm_print_label',
191 'entity' => 'PrintLabel',
192 'bao' => 'CRM_Core_DAO_PrintLabel',
196 'label_format_name' => [
197 'name' => 'label_format_name',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Label Format'),
200 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
202 'size' => CRM_Utils_Type
::HUGE
,
203 'where' => 'civicrm_print_label.label_format_name',
204 'table_name' => 'civicrm_print_label',
205 'entity' => 'PrintLabel',
206 'bao' => 'CRM_Core_DAO_PrintLabel',
211 'pseudoconstant' => [
212 'optionGroupName' => 'name_badge',
213 'optionEditPath' => 'civicrm/admin/options/name_badge',
218 'name' => 'label_type_id',
219 'type' => CRM_Utils_Type
::T_INT
,
220 'title' => ts('Label Type'),
221 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
222 'where' => 'civicrm_print_label.label_type_id',
223 'table_name' => 'civicrm_print_label',
224 'entity' => 'PrintLabel',
225 'bao' => 'CRM_Core_DAO_PrintLabel',
230 'pseudoconstant' => [
231 'optionGroupName' => 'label_type',
232 'optionEditPath' => 'civicrm/admin/options/label_type',
238 'type' => CRM_Utils_Type
::T_LONGTEXT
,
239 'title' => ts('Data'),
240 'description' => ts('contains json encode configurations options'),
241 'where' => 'civicrm_print_label.data',
242 'table_name' => 'civicrm_print_label',
243 'entity' => 'PrintLabel',
244 'bao' => 'CRM_Core_DAO_PrintLabel',
246 'serialize' => self
::SERIALIZE_JSON
,
250 'name' => 'is_default',
251 'type' => CRM_Utils_Type
::T_BOOLEAN
,
252 'title' => ts('Label is Default?'),
253 'description' => ts('Is this default?'),
254 'where' => 'civicrm_print_label.is_default',
256 'table_name' => 'civicrm_print_label',
257 'entity' => 'PrintLabel',
258 'bao' => 'CRM_Core_DAO_PrintLabel',
263 'name' => 'is_active',
264 'type' => CRM_Utils_Type
::T_BOOLEAN
,
265 'title' => ts('Label Is Active?'),
266 'description' => ts('Is this option active?'),
267 'where' => 'civicrm_print_label.is_active',
269 'table_name' => 'civicrm_print_label',
270 'entity' => 'PrintLabel',
271 'bao' => 'CRM_Core_DAO_PrintLabel',
276 'name' => 'is_reserved',
277 'type' => CRM_Utils_Type
::T_BOOLEAN
,
278 'title' => ts('Is Label Reserved?'),
279 'description' => ts('Is this reserved label?'),
280 'where' => 'civicrm_print_label.is_reserved',
282 'table_name' => 'civicrm_print_label',
283 'entity' => 'PrintLabel',
284 'bao' => 'CRM_Core_DAO_PrintLabel',
289 'name' => 'created_id',
290 'type' => CRM_Utils_Type
::T_INT
,
291 'title' => ts('Label Created By'),
292 'description' => ts('FK to civicrm_contact, who created this label layout'),
293 'where' => 'civicrm_print_label.created_id',
294 'table_name' => 'civicrm_print_label',
295 'entity' => 'PrintLabel',
296 'bao' => 'CRM_Core_DAO_PrintLabel',
298 'FKClassName' => 'CRM_Contact_DAO_Contact',
302 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
304 return Civi
::$statics[__CLASS__
]['fields'];
308 * Return a mapping from field-name to the corresponding key (as used in fields()).
311 * Array(string $name => string $uniqueName).
313 public static function &fieldKeys() {
314 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
315 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
317 return Civi
::$statics[__CLASS__
]['fieldKeys'];
321 * Returns the names of this table
325 public static function getTableName() {
326 return self
::$_tableName;
330 * Returns if this table needs to be logged
334 public function getLog() {
339 * Returns the list of fields that can be imported
341 * @param bool $prefix
345 public static function &import($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
351 * Returns the list of fields that can be exported
353 * @param bool $prefix
357 public static function &export($prefix = FALSE) {
358 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
363 * Returns the list of indices
365 * @param bool $localize
369 public static function indices($localize = TRUE) {
371 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;