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:e6d0fdaf773f8dec9b1b9282a41788d9)
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',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Title'),
159 'description' => ts('User title for this label layout'),
161 'size' => CRM_Utils_Type
::HUGE
,
162 'where' => 'civicrm_print_label.title',
163 'table_name' => 'civicrm_print_label',
164 'entity' => 'PrintLabel',
165 'bao' => 'CRM_Core_DAO_PrintLabel',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Name'),
172 'description' => ts('variable name/programmatic handle for this field.'),
174 'size' => CRM_Utils_Type
::HUGE
,
175 'where' => 'civicrm_print_label.name',
176 'table_name' => 'civicrm_print_label',
177 'entity' => 'PrintLabel',
178 'bao' => 'CRM_Core_DAO_PrintLabel',
182 'name' => 'description',
183 'type' => CRM_Utils_Type
::T_TEXT
,
184 'title' => ts('Description'),
185 'description' => ts('Description of this label layout'),
186 'where' => 'civicrm_print_label.description',
187 'table_name' => 'civicrm_print_label',
188 'entity' => 'PrintLabel',
189 'bao' => 'CRM_Core_DAO_PrintLabel',
192 'label_format_name' => [
193 'name' => 'label_format_name',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Label Format'),
196 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
198 'size' => CRM_Utils_Type
::HUGE
,
199 'where' => 'civicrm_print_label.label_format_name',
200 'table_name' => 'civicrm_print_label',
201 'entity' => 'PrintLabel',
202 'bao' => 'CRM_Core_DAO_PrintLabel',
207 'pseudoconstant' => [
208 'optionGroupName' => 'name_badge',
209 'optionEditPath' => 'civicrm/admin/options/name_badge',
213 'name' => 'label_type_id',
214 'type' => CRM_Utils_Type
::T_INT
,
215 'title' => ts('Label Type'),
216 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
217 'where' => 'civicrm_print_label.label_type_id',
218 'table_name' => 'civicrm_print_label',
219 'entity' => 'PrintLabel',
220 'bao' => 'CRM_Core_DAO_PrintLabel',
225 'pseudoconstant' => [
226 'optionGroupName' => 'label_type',
227 'optionEditPath' => 'civicrm/admin/options/label_type',
232 'type' => CRM_Utils_Type
::T_LONGTEXT
,
233 'title' => ts('Data'),
234 'description' => ts('contains json encode configurations options'),
235 'where' => 'civicrm_print_label.data',
236 'table_name' => 'civicrm_print_label',
237 'entity' => 'PrintLabel',
238 'bao' => 'CRM_Core_DAO_PrintLabel',
240 'serialize' => self
::SERIALIZE_JSON
,
243 'name' => 'is_default',
244 'type' => CRM_Utils_Type
::T_BOOLEAN
,
245 'title' => ts('Label is Default?'),
246 'description' => ts('Is this default?'),
247 'where' => 'civicrm_print_label.is_default',
249 'table_name' => 'civicrm_print_label',
250 'entity' => 'PrintLabel',
251 'bao' => 'CRM_Core_DAO_PrintLabel',
255 'name' => 'is_active',
256 'type' => CRM_Utils_Type
::T_BOOLEAN
,
257 'title' => ts('Label Is Active?'),
258 'description' => ts('Is this option active?'),
259 'where' => 'civicrm_print_label.is_active',
261 'table_name' => 'civicrm_print_label',
262 'entity' => 'PrintLabel',
263 'bao' => 'CRM_Core_DAO_PrintLabel',
267 'name' => 'is_reserved',
268 'type' => CRM_Utils_Type
::T_BOOLEAN
,
269 'title' => ts('Is Label Reserved?'),
270 'description' => ts('Is this reserved label?'),
271 'where' => 'civicrm_print_label.is_reserved',
273 'table_name' => 'civicrm_print_label',
274 'entity' => 'PrintLabel',
275 'bao' => 'CRM_Core_DAO_PrintLabel',
279 'name' => 'created_id',
280 'type' => CRM_Utils_Type
::T_INT
,
281 'title' => ts('Label Created By'),
282 'description' => ts('FK to civicrm_contact, who created this label layout'),
283 'where' => 'civicrm_print_label.created_id',
284 'table_name' => 'civicrm_print_label',
285 'entity' => 'PrintLabel',
286 'bao' => 'CRM_Core_DAO_PrintLabel',
288 'FKClassName' => 'CRM_Contact_DAO_Contact',
291 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
293 return Civi
::$statics[__CLASS__
]['fields'];
297 * Return a mapping from field-name to the corresponding key (as used in fields()).
300 * Array(string $name => string $uniqueName).
302 public static function &fieldKeys() {
303 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
304 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
306 return Civi
::$statics[__CLASS__
]['fieldKeys'];
310 * Returns the names of this table
314 public static function getTableName() {
315 return self
::$_tableName;
319 * Returns if this table needs to be logged
323 public function getLog() {
328 * Returns the list of fields that can be imported
330 * @param bool $prefix
334 public static function &import($prefix = FALSE) {
335 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
340 * Returns the list of fields that can be exported
342 * @param bool $prefix
346 public static function &export($prefix = FALSE) {
347 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
352 * Returns the list of indices
354 * @param bool $localize
358 public static function indices($localize = TRUE) {
360 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;