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:9612aababed43ba4eaacc71a727c5ed9)
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',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Title'),
165 'description' => ts('User title for this label layout'),
167 'size' => CRM_Utils_Type
::HUGE
,
168 'where' => 'civicrm_print_label.title',
169 'table_name' => 'civicrm_print_label',
170 'entity' => 'PrintLabel',
171 'bao' => 'CRM_Core_DAO_PrintLabel',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Name'),
179 'description' => ts('variable name/programmatic handle for this field.'),
181 'size' => CRM_Utils_Type
::HUGE
,
182 'where' => 'civicrm_print_label.name',
183 'table_name' => 'civicrm_print_label',
184 'entity' => 'PrintLabel',
185 'bao' => 'CRM_Core_DAO_PrintLabel',
190 'name' => 'description',
191 'type' => CRM_Utils_Type
::T_TEXT
,
192 'title' => ts('Description'),
193 'description' => ts('Description of this label layout'),
194 'where' => 'civicrm_print_label.description',
195 'table_name' => 'civicrm_print_label',
196 'entity' => 'PrintLabel',
197 'bao' => 'CRM_Core_DAO_PrintLabel',
201 'label_format_name' => [
202 'name' => 'label_format_name',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('Label Format'),
205 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
207 'size' => CRM_Utils_Type
::HUGE
,
208 'where' => 'civicrm_print_label.label_format_name',
209 'table_name' => 'civicrm_print_label',
210 'entity' => 'PrintLabel',
211 'bao' => 'CRM_Core_DAO_PrintLabel',
216 'pseudoconstant' => [
217 'optionGroupName' => 'name_badge',
218 'optionEditPath' => 'civicrm/admin/options/name_badge',
223 'name' => 'label_type_id',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Label Type'),
226 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
227 'where' => 'civicrm_print_label.label_type_id',
228 'table_name' => 'civicrm_print_label',
229 'entity' => 'PrintLabel',
230 'bao' => 'CRM_Core_DAO_PrintLabel',
235 'pseudoconstant' => [
236 'optionGroupName' => 'label_type',
237 'optionEditPath' => 'civicrm/admin/options/label_type',
243 'type' => CRM_Utils_Type
::T_LONGTEXT
,
244 'title' => ts('Data'),
245 'description' => ts('contains json encode configurations options'),
246 'where' => 'civicrm_print_label.data',
247 'table_name' => 'civicrm_print_label',
248 'entity' => 'PrintLabel',
249 'bao' => 'CRM_Core_DAO_PrintLabel',
251 'serialize' => self
::SERIALIZE_JSON
,
255 'name' => 'is_default',
256 'type' => CRM_Utils_Type
::T_BOOLEAN
,
257 'title' => ts('Label is Default?'),
258 'description' => ts('Is this default?'),
259 'where' => 'civicrm_print_label.is_default',
261 'table_name' => 'civicrm_print_label',
262 'entity' => 'PrintLabel',
263 'bao' => 'CRM_Core_DAO_PrintLabel',
268 'name' => 'is_active',
269 'type' => CRM_Utils_Type
::T_BOOLEAN
,
270 'title' => ts('Label Is Active?'),
271 'description' => ts('Is this option active?'),
272 'where' => 'civicrm_print_label.is_active',
274 'table_name' => 'civicrm_print_label',
275 'entity' => 'PrintLabel',
276 'bao' => 'CRM_Core_DAO_PrintLabel',
281 'name' => 'is_reserved',
282 'type' => CRM_Utils_Type
::T_BOOLEAN
,
283 'title' => ts('Is Label Reserved?'),
284 'description' => ts('Is this reserved label?'),
285 'where' => 'civicrm_print_label.is_reserved',
287 'table_name' => 'civicrm_print_label',
288 'entity' => 'PrintLabel',
289 'bao' => 'CRM_Core_DAO_PrintLabel',
294 'name' => 'created_id',
295 'type' => CRM_Utils_Type
::T_INT
,
296 'title' => ts('Label Created By'),
297 'description' => ts('FK to civicrm_contact, who created this label layout'),
298 'where' => 'civicrm_print_label.created_id',
299 'table_name' => 'civicrm_print_label',
300 'entity' => 'PrintLabel',
301 'bao' => 'CRM_Core_DAO_PrintLabel',
303 'FKClassName' => 'CRM_Contact_DAO_Contact',
307 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
309 return Civi
::$statics[__CLASS__
]['fields'];
313 * Return a mapping from field-name to the corresponding key (as used in fields()).
316 * Array(string $name => string $uniqueName).
318 public static function &fieldKeys() {
319 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
320 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
322 return Civi
::$statics[__CLASS__
]['fieldKeys'];
326 * Returns the names of this table
330 public static function getTableName() {
331 return self
::$_tableName;
335 * Returns if this table needs to be logged
339 public function getLog() {
344 * Returns the list of fields that can be imported
346 * @param bool $prefix
350 public static function &import($prefix = FALSE) {
351 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
356 * Returns the list of fields that can be exported
358 * @param bool $prefix
362 public static function &export($prefix = FALSE) {
363 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
368 * Returns the list of indices
370 * @param bool $localize
374 public static function indices($localize = TRUE) {
376 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;