Regen DAOs with new import() / export()
[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 value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = false;
69 /**
70 *
71 * @var int unsigned
72 */
73 public $id;
74 /**
75 * User title for for this label layout
76 *
77 * @var string
78 */
79 public $title;
80 /**
81 * variable name/programmatic handle for this field.
82 *
83 * @var string
84 */
85 public $name;
86 /**
87 * Description of this label layout
88 *
89 * @var text
90 */
91 public $description;
92 /**
93 * This refers to name column of civicrm_option_value row in name_badge option group
94 *
95 * @var string
96 */
97 public $label_format_name;
98 /**
99 * Implicit FK to civicrm_option_value row in NEW label_type option group
100 *
101 * @var int unsigned
102 */
103 public $label_type_id;
104 /**
105 * contains json encode configurations options
106 *
107 * @var longtext
108 */
109 public $data;
110 /**
111 * Is this default?
112 *
113 * @var boolean
114 */
115 public $is_default;
116 /**
117 * Is this option active?
118 *
119 * @var boolean
120 */
121 public $is_active;
122 /**
123 * Is this reserved label?
124 *
125 * @var boolean
126 */
127 public $is_reserved;
128 /**
129 * FK to civicrm_contact, who created this label layout
130 *
131 * @var int unsigned
132 */
133 public $created_id;
134 /**
135 * class constructor
136 *
137 * @return civicrm_print_label
138 */
139 function __construct() {
140 $this->__table = 'civicrm_print_label';
141 parent::__construct();
142 }
143 /**
144 * Returns foreign keys and entity references
145 *
146 * @return array
147 * [CRM_Core_Reference_Interface]
148 */
149 static function getReferenceColumns() {
150 if (!self::$_links) {
151 self::$_links = static ::createReferenceColumns(__CLASS__);
152 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
153 }
154 return self::$_links;
155 }
156 /**
157 * Returns all the column names of this table
158 *
159 * @return array
160 */
161 static function &fields() {
162 if (!(self::$_fields)) {
163 self::$_fields = array(
164 'id' => array(
165 'name' => 'id',
166 'type' => CRM_Utils_Type::T_INT,
167 'title' => ts('Print Label ID') ,
168 'required' => true,
169 ) ,
170 'title' => array(
171 'name' => 'title',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('Title') ,
174 'description' => 'User title for for this label layout',
175 'maxlength' => 255,
176 'size' => CRM_Utils_Type::HUGE,
177 ) ,
178 'name' => array(
179 'name' => 'name',
180 'type' => CRM_Utils_Type::T_STRING,
181 'title' => ts('Name') ,
182 'description' => 'variable name/programmatic handle for this field.',
183 'maxlength' => 255,
184 'size' => CRM_Utils_Type::HUGE,
185 ) ,
186 'description' => array(
187 'name' => 'description',
188 'type' => CRM_Utils_Type::T_TEXT,
189 'title' => ts('Description') ,
190 'description' => 'Description of this label layout',
191 ) ,
192 'label_format_name' => array(
193 'name' => 'label_format_name',
194 'type' => CRM_Utils_Type::T_STRING,
195 'title' => ts('Label Format') ,
196 'description' => 'This refers to name column of civicrm_option_value row in name_badge option group',
197 'maxlength' => 255,
198 'size' => CRM_Utils_Type::HUGE,
199 'html' => array(
200 'type' => 'Select',
201 ) ,
202 'pseudoconstant' => array(
203 'optionGroupName' => 'name_badge',
204 'optionEditPath' => 'civicrm/admin/options/name_badge',
205 )
206 ) ,
207 'label_type_id' => array(
208 'name' => 'label_type_id',
209 'type' => CRM_Utils_Type::T_INT,
210 'title' => ts('Label Type') ,
211 'description' => 'Implicit FK to civicrm_option_value row in NEW label_type option group',
212 'html' => array(
213 'type' => 'Select',
214 ) ,
215 'pseudoconstant' => array(
216 'optionGroupName' => 'label_type',
217 'optionEditPath' => 'civicrm/admin/options/label_type',
218 )
219 ) ,
220 'data' => array(
221 'name' => 'data',
222 'type' => CRM_Utils_Type::T_LONGTEXT,
223 'title' => ts('Data') ,
224 'description' => 'contains json encode configurations options',
225 ) ,
226 'is_default' => array(
227 'name' => 'is_default',
228 'type' => CRM_Utils_Type::T_BOOLEAN,
229 'title' => ts('Label is Default?') ,
230 'description' => 'Is this default?',
231 'default' => '1',
232 ) ,
233 'is_active' => array(
234 'name' => 'is_active',
235 'type' => CRM_Utils_Type::T_BOOLEAN,
236 'title' => ts('Label Is Active?') ,
237 'description' => 'Is this option active?',
238 'default' => '1',
239 ) ,
240 'is_reserved' => array(
241 'name' => 'is_reserved',
242 'type' => CRM_Utils_Type::T_BOOLEAN,
243 'title' => ts('Is Label Reserved?') ,
244 'description' => 'Is this reserved label?',
245 'default' => '1',
246 ) ,
247 'created_id' => array(
248 'name' => 'created_id',
249 'type' => CRM_Utils_Type::T_INT,
250 'title' => ts('Label Created By') ,
251 'description' => 'FK to civicrm_contact, who created this label layout',
252 'FKClassName' => 'CRM_Contact_DAO_Contact',
253 ) ,
254 );
255 }
256 return self::$_fields;
257 }
258 /**
259 * Returns an array containing, for each field, the arary key used for that
260 * field in self::$_fields.
261 *
262 * @return array
263 */
264 static function &fieldKeys() {
265 if (!(self::$_fieldKeys)) {
266 self::$_fieldKeys = array(
267 'id' => 'id',
268 'title' => 'title',
269 'name' => 'name',
270 'description' => 'description',
271 'label_format_name' => 'label_format_name',
272 'label_type_id' => 'label_type_id',
273 'data' => 'data',
274 'is_default' => 'is_default',
275 'is_active' => 'is_active',
276 'is_reserved' => 'is_reserved',
277 'created_id' => 'created_id',
278 );
279 }
280 return self::$_fieldKeys;
281 }
282 /**
283 * Returns the names of this table
284 *
285 * @return string
286 */
287 static function getTableName() {
288 return self::$_tableName;
289 }
290 /**
291 * Returns if this table needs to be logged
292 *
293 * @return boolean
294 */
295 function getLog() {
296 return self::$_log;
297 }
298 /**
299 * Returns the list of fields that can be imported
300 *
301 * @param bool $prefix
302 *
303 * @return array
304 */
305 static function &import($prefix = false) {
306 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, array());
307 return $r;
308 }
309 /**
310 * Returns the list of fields that can be exported
311 *
312 * @param bool $prefix
313 *
314 * @return array
315 */
316 static function &export($prefix = false) {
317 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, array());
318 return $r;
319 }
320 }