fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Core / DAO / PrintLabel.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Core/PrintLabel.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:f918d361f86f65ae2e6691b2d2dc062f)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_print_label';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * User title for for this label layout
90 *
91 * @var string
92 */
93 public $title;
94 /**
95 * variable name/programmatic handle for this field.
96 *
97 * @var string
98 */
99 public $name;
100 /**
101 * Description of this label layout
102 *
103 * @var text
104 */
105 public $description;
106 /**
107 * This refers to name column of civicrm_option_value row in name_badge option group
108 *
109 * @var string
110 */
111 public $label_format_name;
112 /**
113 * Implicit FK to civicrm_option_value row in NEW label_type option group
114 *
115 * @var int unsigned
116 */
117 public $label_type_id;
118 /**
119 * contains json encode configurations options
120 *
121 * @var longtext
122 */
123 public $data;
124 /**
125 * Is this default?
126 *
127 * @var boolean
128 */
129 public $is_default;
130 /**
131 * Is this option active?
132 *
133 * @var boolean
134 */
135 public $is_active;
136 /**
137 * Is this reserved label?
138 *
139 * @var boolean
140 */
141 public $is_reserved;
142 /**
143 * FK to civicrm_contact, who created this label layout
144 *
145 * @var int unsigned
146 */
147 public $created_id;
148 /**
149 * class constructor
150 *
151 * @return civicrm_print_label
152 */
153 function __construct() {
154 $this->__table = 'civicrm_print_label';
155 parent::__construct();
156 }
157 /**
158 * Returns foreign keys and entity references
159 *
160 * @return array
161 * [CRM_Core_Reference_Interface]
162 */
163 static function getReferenceColumns() {
164 if (!self::$_links) {
165 self::$_links = static ::createReferenceColumns(__CLASS__);
166 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
167 }
168 return self::$_links;
169 }
170 /**
171 * Returns all the column names of this table
172 *
173 * @return array
174 */
175 static function &fields() {
176 if (!(self::$_fields)) {
177 self::$_fields = array(
178 'id' => array(
179 'name' => 'id',
180 'type' => CRM_Utils_Type::T_INT,
181 'title' => ts('Print Label ID') ,
182 'required' => true,
183 ) ,
184 'title' => array(
185 'name' => 'title',
186 'type' => CRM_Utils_Type::T_STRING,
187 'title' => ts('Title') ,
188 'description' => 'User title for for this label layout',
189 'maxlength' => 255,
190 'size' => CRM_Utils_Type::HUGE,
191 ) ,
192 'name' => array(
193 'name' => 'name',
194 'type' => CRM_Utils_Type::T_STRING,
195 'title' => ts('Name') ,
196 'description' => 'variable name/programmatic handle for this field.',
197 'maxlength' => 255,
198 'size' => CRM_Utils_Type::HUGE,
199 ) ,
200 'description' => array(
201 'name' => 'description',
202 'type' => CRM_Utils_Type::T_TEXT,
203 'title' => ts('Description') ,
204 'description' => 'Description of this label layout',
205 ) ,
206 'label_format_name' => array(
207 'name' => 'label_format_name',
208 'type' => CRM_Utils_Type::T_STRING,
209 'title' => ts('Label Format') ,
210 'description' => 'This refers to name column of civicrm_option_value row in name_badge option group',
211 'maxlength' => 255,
212 'size' => CRM_Utils_Type::HUGE,
213 'html' => array(
214 'type' => 'Select',
215 ) ,
216 'pseudoconstant' => array(
217 'optionGroupName' => 'name_badge',
218 'optionEditPath' => 'civicrm/admin/options/name_badge',
219 )
220 ) ,
221 'label_type_id' => array(
222 'name' => 'label_type_id',
223 'type' => CRM_Utils_Type::T_INT,
224 'title' => ts('Label Type') ,
225 'description' => 'Implicit FK to civicrm_option_value row in NEW label_type option group',
226 'html' => array(
227 'type' => 'Select',
228 ) ,
229 'pseudoconstant' => array(
230 'optionGroupName' => 'label_type',
231 'optionEditPath' => 'civicrm/admin/options/label_type',
232 )
233 ) ,
234 'data' => array(
235 'name' => 'data',
236 'type' => CRM_Utils_Type::T_LONGTEXT,
237 'title' => ts('Data') ,
238 'description' => 'contains json encode configurations options',
239 ) ,
240 'is_default' => array(
241 'name' => 'is_default',
242 'type' => CRM_Utils_Type::T_BOOLEAN,
243 'title' => ts('Label is Default?') ,
244 'description' => 'Is this default?',
245 'default' => '1',
246 ) ,
247 'is_active' => array(
248 'name' => 'is_active',
249 'type' => CRM_Utils_Type::T_BOOLEAN,
250 'title' => ts('Label Is Active?') ,
251 'description' => 'Is this option active?',
252 'default' => '1',
253 ) ,
254 'is_reserved' => array(
255 'name' => 'is_reserved',
256 'type' => CRM_Utils_Type::T_BOOLEAN,
257 'title' => ts('Is Label Reserved?') ,
258 'description' => 'Is this reserved label?',
259 'default' => '1',
260 ) ,
261 'created_id' => array(
262 'name' => 'created_id',
263 'type' => CRM_Utils_Type::T_INT,
264 'title' => ts('Label Created By') ,
265 'description' => 'FK to civicrm_contact, who created this label layout',
266 'FKClassName' => 'CRM_Contact_DAO_Contact',
267 ) ,
268 );
269 }
270 return self::$_fields;
271 }
272 /**
273 * Returns an array containing, for each field, the arary key used for that
274 * field in self::$_fields.
275 *
276 * @return array
277 */
278 static function &fieldKeys() {
279 if (!(self::$_fieldKeys)) {
280 self::$_fieldKeys = array(
281 'id' => 'id',
282 'title' => 'title',
283 'name' => 'name',
284 'description' => 'description',
285 'label_format_name' => 'label_format_name',
286 'label_type_id' => 'label_type_id',
287 'data' => 'data',
288 'is_default' => 'is_default',
289 'is_active' => 'is_active',
290 'is_reserved' => 'is_reserved',
291 'created_id' => 'created_id',
292 );
293 }
294 return self::$_fieldKeys;
295 }
296 /**
297 * Returns the names of this table
298 *
299 * @return string
300 */
301 static function getTableName() {
302 return self::$_tableName;
303 }
304 /**
305 * Returns if this table needs to be logged
306 *
307 * @return boolean
308 */
309 function getLog() {
310 return self::$_log;
311 }
312 /**
313 * Returns the list of fields that can be imported
314 *
315 * @param bool $prefix
316 *
317 * @return array
318 */
319 static function &import($prefix = false) {
320 if (!(self::$_import)) {
321 self::$_import = array();
322 $fields = self::fields();
323 foreach($fields as $name => $field) {
324 if (CRM_Utils_Array::value('import', $field)) {
325 if ($prefix) {
326 self::$_import['print_label'] = & $fields[$name];
327 } else {
328 self::$_import[$name] = & $fields[$name];
329 }
330 }
331 }
332 }
333 return self::$_import;
334 }
335 /**
336 * Returns the list of fields that can be exported
337 *
338 * @param bool $prefix
339 *
340 * @return array
341 */
342 static function &export($prefix = false) {
343 if (!(self::$_export)) {
344 self::$_export = array();
345 $fields = self::fields();
346 foreach($fields as $name => $field) {
347 if (CRM_Utils_Array::value('export', $field)) {
348 if ($prefix) {
349 self::$_export['print_label'] = & $fields[$name];
350 } else {
351 self::$_export[$name] = & $fields[$name];
352 }
353 }
354 }
355 }
356 return self::$_export;
357 }
358 }