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