3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Core/PrintLabel.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:b472155ff2882fa2c65222e6063f6507)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_PrintLabel
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_print_label';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
89 * User title for for this label layout
95 * variable name/programmatic handle for this field.
101 * Description of this label layout
107 * This refers to name column of civicrm_option_value row in name_badge option group
111 public $label_format_name;
113 * Implicit FK to civicrm_option_value row in NEW label_type option group
117 public $label_type_id;
119 * contains json encode configurations options
131 * Is this option active?
137 * Is this reserved label?
143 * FK to civicrm_contact, who created this label layout
151 * @return civicrm_print_label
153 function __construct() {
154 $this->__table
= 'civicrm_print_label';
155 parent
::__construct();
158 * Returns foreign keys and entity references
161 * [CRM_Core_Reference_Interface]
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');
168 return self
::$_links;
171 * Returns all the column names of this table
175 static function &fields() {
176 if (!(self
::$_fields)) {
177 self
::$_fields = array(
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Print Label ID') ,
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Title') ,
188 'description' => 'User title for for this label layout',
190 'size' => CRM_Utils_Type
::HUGE
,
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Name') ,
196 'description' => 'variable name/programmatic handle for this field.',
198 'size' => CRM_Utils_Type
::HUGE
,
200 'description' => array(
201 'name' => 'description',
202 'type' => CRM_Utils_Type
::T_TEXT
,
203 'title' => ts('Description') ,
204 'description' => 'Description of this label layout',
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',
212 'size' => CRM_Utils_Type
::HUGE
,
216 'pseudoconstant' => array(
217 'optionGroupName' => 'name_badge',
218 'optionEditPath' => 'civicrm/admin/options/name_badge',
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',
229 'pseudoconstant' => array(
230 'optionGroupName' => 'label_type',
231 'optionEditPath' => 'civicrm/admin/options/label_type',
236 'type' => CRM_Utils_Type
::T_LONGTEXT
,
237 'title' => ts('Data') ,
238 'description' => 'contains json encode configurations options',
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?',
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?',
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?',
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',
270 return self
::$_fields;
273 * Returns an array containing, for each field, the arary key used for that
274 * field in self::$_fields.
278 static function &fieldKeys() {
279 if (!(self
::$_fieldKeys)) {
280 self
::$_fieldKeys = array(
284 'description' => 'description',
285 'label_format_name' => 'label_format_name',
286 'label_type_id' => 'label_type_id',
288 'is_default' => 'is_default',
289 'is_active' => 'is_active',
290 'is_reserved' => 'is_reserved',
291 'created_id' => 'created_id',
294 return self
::$_fieldKeys;
297 * Returns the names of this table
301 static function getTableName() {
302 return self
::$_tableName;
305 * Returns if this table needs to be logged
313 * Returns the list of fields that can be imported
315 * @param bool $prefix
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)) {
326 self
::$_import['print_label'] = & $fields[$name];
328 self
::$_import[$name] = & $fields[$name];
333 return self
::$_import;
336 * Returns the list of fields that can be exported
338 * @param bool $prefix
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)) {
349 self
::$_export['print_label'] = & $fields[$name];
351 self
::$_export[$name] = & $fields[$name];
356 return self
::$_export;