Commit | Line | Data |
---|---|---|
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 | |
437fafcf | 33 | * (GenCodeChecksum:f918d361f86f65ae2e6691b2d2dc062f) |
e501603b TO |
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'; | |
e501603b TO |
44 | /** |
45 | * static value to see if we should log any modifications to | |
46 | * this table in the civicrm_log table | |
47 | * | |
48 | * @var boolean | |
49 | */ | |
50 | static $_log = false; | |
51 | /** | |
52 | * | |
53 | * @var int unsigned | |
54 | */ | |
55 | public $id; | |
56 | /** | |
57 | * User title for for this label layout | |
58 | * | |
59 | * @var string | |
60 | */ | |
61 | public $title; | |
62 | /** | |
63 | * variable name/programmatic handle for this field. | |
64 | * | |
65 | * @var string | |
66 | */ | |
67 | public $name; | |
68 | /** | |
69 | * Description of this label layout | |
70 | * | |
71 | * @var text | |
72 | */ | |
73 | public $description; | |
74 | /** | |
75 | * This refers to name column of civicrm_option_value row in name_badge option group | |
76 | * | |
77 | * @var string | |
78 | */ | |
79 | public $label_format_name; | |
80 | /** | |
81 | * Implicit FK to civicrm_option_value row in NEW label_type option group | |
82 | * | |
83 | * @var int unsigned | |
84 | */ | |
85 | public $label_type_id; | |
86 | /** | |
87 | * contains json encode configurations options | |
88 | * | |
89 | * @var longtext | |
90 | */ | |
91 | public $data; | |
92 | /** | |
93 | * Is this default? | |
94 | * | |
95 | * @var boolean | |
96 | */ | |
97 | public $is_default; | |
98 | /** | |
99 | * Is this option active? | |
100 | * | |
101 | * @var boolean | |
102 | */ | |
103 | public $is_active; | |
104 | /** | |
105 | * Is this reserved label? | |
106 | * | |
107 | * @var boolean | |
108 | */ | |
109 | public $is_reserved; | |
110 | /** | |
111 | * FK to civicrm_contact, who created this label layout | |
112 | * | |
113 | * @var int unsigned | |
114 | */ | |
115 | public $created_id; | |
116 | /** | |
117 | * class constructor | |
118 | * | |
119 | * @return civicrm_print_label | |
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() { | |
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, | |
152 | ) , | |
153 | 'title' => array( | |
154 | 'name' => 'title', | |
155 | 'type' => CRM_Utils_Type::T_STRING, | |
156 | 'title' => ts('Title') , | |
157 | 'description' => 'User title for for this label layout', | |
158 | 'maxlength' => 255, | |
159 | 'size' => CRM_Utils_Type::HUGE, | |
160 | ) , | |
161 | 'name' => array( | |
162 | 'name' => 'name', | |
163 | 'type' => CRM_Utils_Type::T_STRING, | |
164 | 'title' => ts('Name') , | |
165 | 'description' => 'variable name/programmatic handle for this field.', | |
166 | 'maxlength' => 255, | |
167 | 'size' => CRM_Utils_Type::HUGE, | |
168 | ) , | |
169 | 'description' => array( | |
170 | 'name' => 'description', | |
171 | 'type' => CRM_Utils_Type::T_TEXT, | |
172 | 'title' => ts('Description') , | |
173 | 'description' => 'Description of this label layout', | |
174 | ) , | |
175 | 'label_format_name' => array( | |
176 | 'name' => 'label_format_name', | |
177 | 'type' => CRM_Utils_Type::T_STRING, | |
178 | 'title' => ts('Label Format') , | |
179 | 'description' => 'This refers to name column of civicrm_option_value row in name_badge option group', | |
180 | 'maxlength' => 255, | |
181 | 'size' => CRM_Utils_Type::HUGE, | |
182 | 'html' => array( | |
183 | 'type' => 'Select', | |
184 | ) , | |
185 | 'pseudoconstant' => array( | |
186 | 'optionGroupName' => 'name_badge', | |
187 | 'optionEditPath' => 'civicrm/admin/options/name_badge', | |
188 | ) | |
189 | ) , | |
190 | 'label_type_id' => array( | |
191 | 'name' => 'label_type_id', | |
192 | 'type' => CRM_Utils_Type::T_INT, | |
193 | 'title' => ts('Label Type') , | |
194 | 'description' => 'Implicit FK to civicrm_option_value row in NEW label_type option group', | |
195 | 'html' => array( | |
196 | 'type' => 'Select', | |
197 | ) , | |
198 | 'pseudoconstant' => array( | |
199 | 'optionGroupName' => 'label_type', | |
200 | 'optionEditPath' => 'civicrm/admin/options/label_type', | |
201 | ) | |
202 | ) , | |
203 | 'data' => array( | |
204 | 'name' => 'data', | |
205 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
206 | 'title' => ts('Data') , | |
207 | 'description' => 'contains json encode configurations options', | |
208 | ) , | |
209 | 'is_default' => array( | |
210 | 'name' => 'is_default', | |
211 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
212 | 'title' => ts('Label is Default?') , | |
213 | 'description' => 'Is this default?', | |
214 | 'default' => '1', | |
215 | ) , | |
216 | 'is_active' => array( | |
217 | 'name' => 'is_active', | |
218 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
219 | 'title' => ts('Label Is Active?') , | |
220 | 'description' => 'Is this option active?', | |
221 | 'default' => '1', | |
222 | ) , | |
223 | 'is_reserved' => array( | |
224 | 'name' => 'is_reserved', | |
225 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
226 | 'title' => ts('Is Label Reserved?') , | |
227 | 'description' => 'Is this reserved label?', | |
228 | 'default' => '1', | |
229 | ) , | |
230 | 'created_id' => array( | |
231 | 'name' => 'created_id', | |
232 | 'type' => CRM_Utils_Type::T_INT, | |
233 | 'title' => ts('Label Created By') , | |
234 | 'description' => 'FK to civicrm_contact, who created this label layout', | |
235 | 'FKClassName' => 'CRM_Contact_DAO_Contact', | |
236 | ) , | |
237 | ); | |
346aaaba | 238 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 239 | } |
346aaaba | 240 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
241 | } |
242 | /** | |
bd8e0b14 | 243 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
244 | * |
245 | * @return array | |
bd8e0b14 | 246 | * Array(string $name => string $uniqueName). |
e501603b TO |
247 | */ |
248 | static function &fieldKeys() { | |
bd8e0b14 TO |
249 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
250 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 251 | } |
bd8e0b14 | 252 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
253 | } |
254 | /** | |
255 | * Returns the names of this table | |
256 | * | |
257 | * @return string | |
258 | */ | |
259 | static function getTableName() { | |
260 | return self::$_tableName; | |
261 | } | |
262 | /** | |
263 | * Returns if this table needs to be logged | |
264 | * | |
265 | * @return boolean | |
266 | */ | |
267 | function getLog() { | |
268 | return self::$_log; | |
269 | } | |
270 | /** | |
271 | * Returns the list of fields that can be imported | |
272 | * | |
273 | * @param bool $prefix | |
274 | * | |
275 | * @return array | |
276 | */ | |
277 | static function &import($prefix = false) { | |
60808919 TO |
278 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, array()); |
279 | return $r; | |
e501603b TO |
280 | } |
281 | /** | |
282 | * Returns the list of fields that can be exported | |
283 | * | |
284 | * @param bool $prefix | |
285 | * | |
286 | * @return array | |
287 | */ | |
288 | static function &export($prefix = false) { | |
60808919 TO |
289 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, array()); |
290 | return $r; | |
e501603b TO |
291 | } |
292 | } |