Merge pull request #10549 from jitendrapurohit/CRM-20761
[civicrm-core.git] / CRM / Core / DAO / PrintLabel.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Core/PrintLabel.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:af33d193b72fd8c8bf260c0625c7acf6)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_PrintLabel constructor.
39 */
40 class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_print_label';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 /**
119 * Class constructor.
120 */
121 function __construct() {
122 $this->__table = 'civicrm_print_label';
123 parent::__construct();
124 }
125 /**
126 * Returns foreign keys and entity references.
127 *
128 * @return array
129 * [CRM_Core_Reference_Interface]
130 */
131 static function getReferenceColumns() {
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']);
136 }
137 return Civi::$statics[__CLASS__]['links'];
138 }
139 /**
140 * Returns all the column names of this table
141 *
142 * @return array
143 */
144 static function &fields() {
145 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
146 Civi::$statics[__CLASS__]['fields'] = array(
147 'id' => array(
148 'name' => 'id',
149 'type' => CRM_Utils_Type::T_INT,
150 'title' => ts('Print Label ID') ,
151 'required' => true,
152 'table_name' => 'civicrm_print_label',
153 'entity' => 'PrintLabel',
154 'bao' => 'CRM_Core_DAO_PrintLabel',
155 'localizable' => 0,
156 ) ,
157 'title' => array(
158 'name' => 'title',
159 'type' => CRM_Utils_Type::T_STRING,
160 'title' => ts('Title') ,
161 'description' => 'User title for for this label layout',
162 'maxlength' => 255,
163 'size' => CRM_Utils_Type::HUGE,
164 'table_name' => 'civicrm_print_label',
165 'entity' => 'PrintLabel',
166 'bao' => 'CRM_Core_DAO_PrintLabel',
167 'localizable' => 0,
168 ) ,
169 'name' => array(
170 'name' => 'name',
171 'type' => CRM_Utils_Type::T_STRING,
172 'title' => ts('Name') ,
173 'description' => 'variable name/programmatic handle for this field.',
174 'maxlength' => 255,
175 'size' => CRM_Utils_Type::HUGE,
176 'table_name' => 'civicrm_print_label',
177 'entity' => 'PrintLabel',
178 'bao' => 'CRM_Core_DAO_PrintLabel',
179 'localizable' => 0,
180 ) ,
181 'description' => array(
182 'name' => 'description',
183 'type' => CRM_Utils_Type::T_TEXT,
184 'title' => ts('Description') ,
185 'description' => 'Description of this label layout',
186 'table_name' => 'civicrm_print_label',
187 'entity' => 'PrintLabel',
188 'bao' => 'CRM_Core_DAO_PrintLabel',
189 'localizable' => 0,
190 ) ,
191 'label_format_name' => array(
192 'name' => 'label_format_name',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('Label Format') ,
195 'description' => 'This refers to name column of civicrm_option_value row in name_badge option group',
196 'maxlength' => 255,
197 'size' => CRM_Utils_Type::HUGE,
198 'table_name' => 'civicrm_print_label',
199 'entity' => 'PrintLabel',
200 'bao' => 'CRM_Core_DAO_PrintLabel',
201 'localizable' => 0,
202 'html' => array(
203 'type' => 'Select',
204 ) ,
205 'pseudoconstant' => array(
206 'optionGroupName' => 'name_badge',
207 'optionEditPath' => 'civicrm/admin/options/name_badge',
208 )
209 ) ,
210 'label_type_id' => array(
211 'name' => 'label_type_id',
212 'type' => CRM_Utils_Type::T_INT,
213 'title' => ts('Label Type') ,
214 'description' => 'Implicit FK to civicrm_option_value row in NEW label_type option group',
215 'table_name' => 'civicrm_print_label',
216 'entity' => 'PrintLabel',
217 'bao' => 'CRM_Core_DAO_PrintLabel',
218 'localizable' => 0,
219 'html' => array(
220 'type' => 'Select',
221 ) ,
222 'pseudoconstant' => array(
223 'optionGroupName' => 'label_type',
224 'optionEditPath' => 'civicrm/admin/options/label_type',
225 )
226 ) ,
227 'data' => array(
228 'name' => 'data',
229 'type' => CRM_Utils_Type::T_LONGTEXT,
230 'title' => ts('Data') ,
231 'description' => 'contains json encode configurations options',
232 'table_name' => 'civicrm_print_label',
233 'entity' => 'PrintLabel',
234 'bao' => 'CRM_Core_DAO_PrintLabel',
235 'localizable' => 0,
236 ) ,
237 'is_default' => array(
238 'name' => 'is_default',
239 'type' => CRM_Utils_Type::T_BOOLEAN,
240 'title' => ts('Label is Default?') ,
241 'description' => 'Is this default?',
242 'default' => '1',
243 'table_name' => 'civicrm_print_label',
244 'entity' => 'PrintLabel',
245 'bao' => 'CRM_Core_DAO_PrintLabel',
246 'localizable' => 0,
247 ) ,
248 'is_active' => array(
249 'name' => 'is_active',
250 'type' => CRM_Utils_Type::T_BOOLEAN,
251 'title' => ts('Label Is Active?') ,
252 'description' => 'Is this option active?',
253 'default' => '1',
254 'table_name' => 'civicrm_print_label',
255 'entity' => 'PrintLabel',
256 'bao' => 'CRM_Core_DAO_PrintLabel',
257 'localizable' => 0,
258 ) ,
259 'is_reserved' => array(
260 'name' => 'is_reserved',
261 'type' => CRM_Utils_Type::T_BOOLEAN,
262 'title' => ts('Is Label Reserved?') ,
263 'description' => 'Is this reserved label?',
264 'default' => '1',
265 'table_name' => 'civicrm_print_label',
266 'entity' => 'PrintLabel',
267 'bao' => 'CRM_Core_DAO_PrintLabel',
268 'localizable' => 0,
269 ) ,
270 'created_id' => array(
271 'name' => 'created_id',
272 'type' => CRM_Utils_Type::T_INT,
273 'title' => ts('Label Created By') ,
274 'description' => 'FK to civicrm_contact, who created this label layout',
275 'table_name' => 'civicrm_print_label',
276 'entity' => 'PrintLabel',
277 'bao' => 'CRM_Core_DAO_PrintLabel',
278 'localizable' => 0,
279 'FKClassName' => 'CRM_Contact_DAO_Contact',
280 ) ,
281 );
282 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
283 }
284 return Civi::$statics[__CLASS__]['fields'];
285 }
286 /**
287 * Return a mapping from field-name to the corresponding key (as used in fields()).
288 *
289 * @return array
290 * Array(string $name => string $uniqueName).
291 */
292 static function &fieldKeys() {
293 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
294 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
295 }
296 return Civi::$statics[__CLASS__]['fieldKeys'];
297 }
298 /**
299 * Returns the names of this table
300 *
301 * @return string
302 */
303 static function getTableName() {
304 return self::$_tableName;
305 }
306 /**
307 * Returns if this table needs to be logged
308 *
309 * @return boolean
310 */
311 function getLog() {
312 return self::$_log;
313 }
314 /**
315 * Returns the list of fields that can be imported
316 *
317 * @param bool $prefix
318 *
319 * @return array
320 */
321 static function &import($prefix = false) {
322 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, array());
323 return $r;
324 }
325 /**
326 * Returns the list of fields that can be exported
327 *
328 * @param bool $prefix
329 *
330 * @return array
331 */
332 static function &export($prefix = false) {
333 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, array());
334 return $r;
335 }
336 /**
337 * Returns the list of indices
338 */
339 public static function indices($localize = TRUE) {
340 $indices = array();
341 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
342 }
343 }