Merge pull request #9680 from h-c-c/CRM-19881
[civicrm-core.git] / CRM / Core / DAO / PrintLabel.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/PrintLabel.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
522a26c9 33 * (GenCodeChecksum:bcabbb7ab1a643e2aeafe9cc0714027b)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_PrintLabel constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_print_label';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * User title for for this label layout
60 *
61 * @var string
62 */
63 public $title;
64 /**
65 * variable name/programmatic handle for this field.
66 *
67 * @var string
68 */
69 public $name;
70 /**
71 * Description of this label layout
72 *
73 * @var text
74 */
75 public $description;
76 /**
77 * This refers to name column of civicrm_option_value row in name_badge option group
78 *
79 * @var string
80 */
81 public $label_format_name;
82 /**
83 * Implicit FK to civicrm_option_value row in NEW label_type option group
84 *
85 * @var int unsigned
86 */
87 public $label_type_id;
88 /**
89 * contains json encode configurations options
90 *
91 * @var longtext
92 */
93 public $data;
94 /**
95 * Is this default?
96 *
97 * @var boolean
98 */
99 public $is_default;
100 /**
101 * Is this option active?
102 *
103 * @var boolean
104 */
105 public $is_active;
106 /**
107 * Is this reserved label?
108 *
109 * @var boolean
110 */
111 public $is_reserved;
112 /**
113 * FK to civicrm_contact, who created this label layout
114 *
115 * @var int unsigned
116 */
117 public $created_id;
118 /**
f41f0342 119 * Class constructor.
e501603b
TO
120 */
121 function __construct() {
122 $this->__table = 'civicrm_print_label';
123 parent::__construct();
124 }
125 /**
f41f0342 126 * Returns foreign keys and entity references.
e501603b
TO
127 *
128 * @return array
129 * [CRM_Core_Reference_Interface]
130 */
131 static function getReferenceColumns() {
346aaaba
TO
132 if (!isset(Civi::$statics[__CLASS__]['links'])) {
133 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
134 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
135 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 136 }
346aaaba 137 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
138 }
139 /**
140 * Returns all the column names of this table
141 *
142 * @return array
143 */
144 static function &fields() {
346aaaba
TO
145 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
146 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
147 'id' => array(
148 'name' => 'id',
149 'type' => CRM_Utils_Type::T_INT,
150 'title' => ts('Print Label ID') ,
151 'required' => true,
522a26c9 152 'table_name' => 'civicrm_print_label',
153 'entity' => 'PrintLabel',
154 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
155 ) ,
156 'title' => array(
157 'name' => 'title',
158 'type' => CRM_Utils_Type::T_STRING,
159 'title' => ts('Title') ,
160 'description' => 'User title for for this label layout',
161 'maxlength' => 255,
162 'size' => CRM_Utils_Type::HUGE,
522a26c9 163 'table_name' => 'civicrm_print_label',
164 'entity' => 'PrintLabel',
165 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
166 ) ,
167 'name' => array(
168 'name' => 'name',
169 'type' => CRM_Utils_Type::T_STRING,
170 'title' => ts('Name') ,
171 'description' => 'variable name/programmatic handle for this field.',
172 'maxlength' => 255,
173 'size' => CRM_Utils_Type::HUGE,
522a26c9 174 'table_name' => 'civicrm_print_label',
175 'entity' => 'PrintLabel',
176 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
177 ) ,
178 'description' => array(
179 'name' => 'description',
180 'type' => CRM_Utils_Type::T_TEXT,
181 'title' => ts('Description') ,
182 'description' => 'Description of this label layout',
522a26c9 183 'table_name' => 'civicrm_print_label',
184 'entity' => 'PrintLabel',
185 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
186 ) ,
187 'label_format_name' => array(
188 'name' => 'label_format_name',
189 'type' => CRM_Utils_Type::T_STRING,
190 'title' => ts('Label Format') ,
191 'description' => 'This refers to name column of civicrm_option_value row in name_badge option group',
192 'maxlength' => 255,
193 'size' => CRM_Utils_Type::HUGE,
522a26c9 194 'table_name' => 'civicrm_print_label',
195 'entity' => 'PrintLabel',
196 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
197 'html' => array(
198 'type' => 'Select',
199 ) ,
200 'pseudoconstant' => array(
201 'optionGroupName' => 'name_badge',
202 'optionEditPath' => 'civicrm/admin/options/name_badge',
203 )
204 ) ,
205 'label_type_id' => array(
206 'name' => 'label_type_id',
207 'type' => CRM_Utils_Type::T_INT,
208 'title' => ts('Label Type') ,
209 'description' => 'Implicit FK to civicrm_option_value row in NEW label_type option group',
522a26c9 210 'table_name' => 'civicrm_print_label',
211 'entity' => 'PrintLabel',
212 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
213 'html' => array(
214 'type' => 'Select',
215 ) ,
216 'pseudoconstant' => array(
217 'optionGroupName' => 'label_type',
218 'optionEditPath' => 'civicrm/admin/options/label_type',
219 )
220 ) ,
221 'data' => array(
222 'name' => 'data',
223 'type' => CRM_Utils_Type::T_LONGTEXT,
224 'title' => ts('Data') ,
225 'description' => 'contains json encode configurations options',
522a26c9 226 'table_name' => 'civicrm_print_label',
227 'entity' => 'PrintLabel',
228 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
229 ) ,
230 'is_default' => array(
231 'name' => 'is_default',
232 'type' => CRM_Utils_Type::T_BOOLEAN,
233 'title' => ts('Label is Default?') ,
234 'description' => 'Is this default?',
235 'default' => '1',
522a26c9 236 'table_name' => 'civicrm_print_label',
237 'entity' => 'PrintLabel',
238 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
239 ) ,
240 'is_active' => array(
241 'name' => 'is_active',
242 'type' => CRM_Utils_Type::T_BOOLEAN,
243 'title' => ts('Label Is Active?') ,
244 'description' => 'Is this option active?',
245 'default' => '1',
522a26c9 246 'table_name' => 'civicrm_print_label',
247 'entity' => 'PrintLabel',
248 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
249 ) ,
250 'is_reserved' => array(
251 'name' => 'is_reserved',
252 'type' => CRM_Utils_Type::T_BOOLEAN,
253 'title' => ts('Is Label Reserved?') ,
254 'description' => 'Is this reserved label?',
255 'default' => '1',
522a26c9 256 'table_name' => 'civicrm_print_label',
257 'entity' => 'PrintLabel',
258 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
259 ) ,
260 'created_id' => array(
261 'name' => 'created_id',
262 'type' => CRM_Utils_Type::T_INT,
263 'title' => ts('Label Created By') ,
264 'description' => 'FK to civicrm_contact, who created this label layout',
522a26c9 265 'table_name' => 'civicrm_print_label',
266 'entity' => 'PrintLabel',
267 'bao' => 'CRM_Core_DAO_PrintLabel',
e501603b
TO
268 'FKClassName' => 'CRM_Contact_DAO_Contact',
269 ) ,
270 );
346aaaba 271 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 272 }
346aaaba 273 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
274 }
275 /**
bd8e0b14 276 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
277 *
278 * @return array
bd8e0b14 279 * Array(string $name => string $uniqueName).
e501603b
TO
280 */
281 static function &fieldKeys() {
bd8e0b14
TO
282 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
283 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 284 }
bd8e0b14 285 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
286 }
287 /**
288 * Returns the names of this table
289 *
290 * @return string
291 */
292 static function getTableName() {
293 return self::$_tableName;
294 }
295 /**
296 * Returns if this table needs to be logged
297 *
298 * @return boolean
299 */
300 function getLog() {
301 return self::$_log;
302 }
303 /**
304 * Returns the list of fields that can be imported
305 *
306 * @param bool $prefix
307 *
308 * @return array
309 */
310 static function &import($prefix = false) {
60808919
TO
311 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, array());
312 return $r;
e501603b
TO
313 }
314 /**
315 * Returns the list of fields that can be exported
316 *
317 * @param bool $prefix
318 *
319 * @return array
320 */
321 static function &export($prefix = false) {
60808919
TO
322 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, array());
323 return $r;
e501603b
TO
324 }
325}