fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Core / DAO / PreferencesDate.php
CommitLineData
e501603b
TO
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/PreferencesDate.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:85f54758c28f13fd4ec48f1bf45a9875)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_preferences_date';
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 = true;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * The meta name for this date (fixed in code)
90 *
91 * @var string
92 */
93 public $name;
94 /**
95 * Description of this date type.
96 *
97 * @var string
98 */
99 public $description;
100 /**
101 * The start offset relative to current year
102 *
103 * @var int
104 */
105 public $start;
106 /**
107 * The end offset relative to current year, can be negative
108 *
109 * @var int
110 */
111 public $end;
112 /**
113 * The date type
114 *
115 * @var string
116 */
117 public $date_format;
118 /**
119 * time format
120 *
121 * @var string
122 */
123 public $time_format;
124 /**
125 * class constructor
126 *
127 * @return civicrm_preferences_date
128 */
129 function __construct() {
130 $this->__table = 'civicrm_preferences_date';
131 parent::__construct();
132 }
133 /**
134 * Returns all the column names of this table
135 *
136 * @return array
137 */
138 static function &fields() {
139 if (!(self::$_fields)) {
140 self::$_fields = array(
141 'id' => array(
142 'name' => 'id',
143 'type' => CRM_Utils_Type::T_INT,
144 'title' => ts('Date Preference ID') ,
145 'required' => true,
146 ) ,
147 'name' => array(
148 'name' => 'name',
149 'type' => CRM_Utils_Type::T_STRING,
150 'title' => ts('Date Preference Name') ,
151 'description' => 'The meta name for this date (fixed in code)',
152 'required' => true,
153 'maxlength' => 64,
154 'size' => CRM_Utils_Type::BIG,
155 ) ,
156 'description' => array(
157 'name' => 'description',
158 'type' => CRM_Utils_Type::T_STRING,
159 'title' => ts('Description') ,
160 'description' => 'Description of this date type.',
161 'maxlength' => 255,
162 'size' => CRM_Utils_Type::HUGE,
163 ) ,
164 'start' => array(
165 'name' => 'start',
166 'type' => CRM_Utils_Type::T_INT,
167 'title' => ts('Start') ,
168 'description' => 'The start offset relative to current year',
169 'required' => true,
170 ) ,
171 'end' => array(
172 'name' => 'end',
173 'type' => CRM_Utils_Type::T_INT,
174 'title' => ts('End Offset') ,
175 'description' => 'The end offset relative to current year, can be negative',
176 'required' => true,
177 ) ,
178 'date_format' => array(
179 'name' => 'date_format',
180 'type' => CRM_Utils_Type::T_STRING,
181 'title' => ts('Date Format') ,
182 'description' => 'The date type',
183 'maxlength' => 64,
184 'size' => CRM_Utils_Type::BIG,
185 ) ,
186 'time_format' => array(
187 'name' => 'time_format',
188 'type' => CRM_Utils_Type::T_STRING,
189 'title' => ts('Time Format') ,
190 'description' => 'time format',
191 'maxlength' => 64,
192 'size' => CRM_Utils_Type::BIG,
193 ) ,
194 );
195 }
196 return self::$_fields;
197 }
198 /**
199 * Returns an array containing, for each field, the arary key used for that
200 * field in self::$_fields.
201 *
202 * @return array
203 */
204 static function &fieldKeys() {
205 if (!(self::$_fieldKeys)) {
206 self::$_fieldKeys = array(
207 'id' => 'id',
208 'name' => 'name',
209 'description' => 'description',
210 'start' => 'start',
211 'end' => 'end',
212 'date_format' => 'date_format',
213 'time_format' => 'time_format',
214 );
215 }
216 return self::$_fieldKeys;
217 }
218 /**
219 * Returns the names of this table
220 *
221 * @return string
222 */
223 static function getTableName() {
224 return self::$_tableName;
225 }
226 /**
227 * Returns if this table needs to be logged
228 *
229 * @return boolean
230 */
231 function getLog() {
232 return self::$_log;
233 }
234 /**
235 * Returns the list of fields that can be imported
236 *
237 * @param bool $prefix
238 *
239 * @return array
240 */
241 static function &import($prefix = false) {
242 if (!(self::$_import)) {
243 self::$_import = array();
244 $fields = self::fields();
245 foreach($fields as $name => $field) {
246 if (CRM_Utils_Array::value('import', $field)) {
247 if ($prefix) {
248 self::$_import['preferences_date'] = & $fields[$name];
249 } else {
250 self::$_import[$name] = & $fields[$name];
251 }
252 }
253 }
254 }
255 return self::$_import;
256 }
257 /**
258 * Returns the list of fields that can be exported
259 *
260 * @param bool $prefix
261 *
262 * @return array
263 */
264 static function &export($prefix = false) {
265 if (!(self::$_export)) {
266 self::$_export = array();
267 $fields = self::fields();
268 foreach($fields as $name => $field) {
269 if (CRM_Utils_Array::value('export', $field)) {
270 if ($prefix) {
271 self::$_export['preferences_date'] = & $fields[$name];
272 } else {
273 self::$_export[$name] = & $fields[$name];
274 }
275 }
276 }
277 }
278 return self::$_export;
279 }
280}