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:b8dffa0c7640137bb8dede0fd7c67cff)
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 foreign keys and entity references.
118 * [CRM_Core_Reference_Interface]
120 public static function getReferenceColumns() {
121 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
122 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
123 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
124 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
126 return Civi
::$statics[__CLASS__
]['links'];
130 * Returns all the column names of this table
134 public static function &fields() {
135 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
136 Civi
::$statics[__CLASS__
]['fields'] = [
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Print Label ID'),
142 'where' => 'civicrm_print_label.id',
143 'table_name' => 'civicrm_print_label',
144 'entity' => 'PrintLabel',
145 'bao' => 'CRM_Core_DAO_PrintLabel',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Title'),
152 'description' => ts('User title for this label layout'),
154 'size' => CRM_Utils_Type
::HUGE
,
155 'where' => 'civicrm_print_label.title',
156 'table_name' => 'civicrm_print_label',
157 'entity' => 'PrintLabel',
158 'bao' => 'CRM_Core_DAO_PrintLabel',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Name'),
165 'description' => ts('variable name/programmatic handle for this field.'),
167 'size' => CRM_Utils_Type
::HUGE
,
168 'where' => 'civicrm_print_label.name',
169 'table_name' => 'civicrm_print_label',
170 'entity' => 'PrintLabel',
171 'bao' => 'CRM_Core_DAO_PrintLabel',
175 'name' => 'description',
176 'type' => CRM_Utils_Type
::T_TEXT
,
177 'title' => ts('Description'),
178 'description' => ts('Description of this label layout'),
179 'where' => 'civicrm_print_label.description',
180 'table_name' => 'civicrm_print_label',
181 'entity' => 'PrintLabel',
182 'bao' => 'CRM_Core_DAO_PrintLabel',
185 'label_format_name' => [
186 'name' => 'label_format_name',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Label Format'),
189 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
191 'size' => CRM_Utils_Type
::HUGE
,
192 'where' => 'civicrm_print_label.label_format_name',
193 'table_name' => 'civicrm_print_label',
194 'entity' => 'PrintLabel',
195 'bao' => 'CRM_Core_DAO_PrintLabel',
200 'pseudoconstant' => [
201 'optionGroupName' => 'name_badge',
202 'optionEditPath' => 'civicrm/admin/options/name_badge',
206 'name' => 'label_type_id',
207 'type' => CRM_Utils_Type
::T_INT
,
208 'title' => ts('Label Type'),
209 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
210 'where' => 'civicrm_print_label.label_type_id',
211 'table_name' => 'civicrm_print_label',
212 'entity' => 'PrintLabel',
213 'bao' => 'CRM_Core_DAO_PrintLabel',
218 'pseudoconstant' => [
219 'optionGroupName' => 'label_type',
220 'optionEditPath' => 'civicrm/admin/options/label_type',
225 'type' => CRM_Utils_Type
::T_LONGTEXT
,
226 'title' => ts('Data'),
227 'description' => ts('contains json encode configurations options'),
228 'where' => 'civicrm_print_label.data',
229 'table_name' => 'civicrm_print_label',
230 'entity' => 'PrintLabel',
231 'bao' => 'CRM_Core_DAO_PrintLabel',
233 'serialize' => self
::SERIALIZE_JSON
,
236 'name' => 'is_default',
237 'type' => CRM_Utils_Type
::T_BOOLEAN
,
238 'title' => ts('Label is Default?'),
239 'description' => ts('Is this default?'),
240 'where' => 'civicrm_print_label.is_default',
242 'table_name' => 'civicrm_print_label',
243 'entity' => 'PrintLabel',
244 'bao' => 'CRM_Core_DAO_PrintLabel',
248 'name' => 'is_active',
249 'type' => CRM_Utils_Type
::T_BOOLEAN
,
250 'title' => ts('Label Is Active?'),
251 'description' => ts('Is this option active?'),
252 'where' => 'civicrm_print_label.is_active',
254 'table_name' => 'civicrm_print_label',
255 'entity' => 'PrintLabel',
256 'bao' => 'CRM_Core_DAO_PrintLabel',
260 'name' => 'is_reserved',
261 'type' => CRM_Utils_Type
::T_BOOLEAN
,
262 'title' => ts('Is Label Reserved?'),
263 'description' => ts('Is this reserved label?'),
264 'where' => 'civicrm_print_label.is_reserved',
266 'table_name' => 'civicrm_print_label',
267 'entity' => 'PrintLabel',
268 'bao' => 'CRM_Core_DAO_PrintLabel',
272 'name' => 'created_id',
273 'type' => CRM_Utils_Type
::T_INT
,
274 'title' => ts('Label Created By'),
275 'description' => ts('FK to civicrm_contact, who created this label layout'),
276 'where' => 'civicrm_print_label.created_id',
277 'table_name' => 'civicrm_print_label',
278 'entity' => 'PrintLabel',
279 'bao' => 'CRM_Core_DAO_PrintLabel',
281 'FKClassName' => 'CRM_Contact_DAO_Contact',
284 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
286 return Civi
::$statics[__CLASS__
]['fields'];
290 * Return a mapping from field-name to the corresponding key (as used in fields()).
293 * Array(string $name => string $uniqueName).
295 public static function &fieldKeys() {
296 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
297 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
299 return Civi
::$statics[__CLASS__
]['fieldKeys'];
303 * Returns the names of this table
307 public static function getTableName() {
308 return self
::$_tableName;
312 * Returns if this table needs to be logged
316 public function getLog() {
321 * Returns the list of fields that can be imported
323 * @param bool $prefix
327 public static function &import($prefix = FALSE) {
328 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'print_label', $prefix, []);
333 * Returns the list of fields that can be exported
335 * @param bool $prefix
339 public static function &export($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'print_label', $prefix, []);
345 * Returns the list of indices
347 * @param bool $localize
351 public static function indices($localize = TRUE) {
353 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;