Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.6 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2015 | | |
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-2015 | |
30 | * | |
31 | * Generated from xml/schema/CRM/Core/PreferencesDate.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
33 | */ | |
34 | require_once 'CRM/Core/DAO.php'; | |
35 | require_once 'CRM/Utils/Type.php'; | |
36 | class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO { | |
37 | /** | |
38 | * static instance to hold the table name | |
39 | * | |
40 | * @var string | |
41 | */ | |
42 | static $_tableName = 'civicrm_preferences_date'; | |
43 | /** | |
44 | * static instance to hold the field values | |
45 | * | |
46 | * @var array | |
47 | */ | |
48 | static $_fields = null; | |
49 | /** | |
50 | * static instance to hold the keys used in $_fields for each field. | |
51 | * | |
52 | * @var array | |
53 | */ | |
54 | static $_fieldKeys = null; | |
55 | /** | |
56 | * static instance to hold the FK relationships | |
57 | * | |
58 | * @var string | |
59 | */ | |
60 | static $_links = null; | |
61 | /** | |
62 | * static instance to hold the values that can | |
63 | * be imported | |
64 | * | |
65 | * @var array | |
66 | */ | |
67 | static $_import = null; | |
68 | /** | |
69 | * static instance to hold the values that can | |
70 | * be exported | |
71 | * | |
72 | * @var array | |
73 | */ | |
74 | static $_export = null; | |
75 | /** | |
76 | * static value to see if we should log any modifications to | |
77 | * this table in the civicrm_log table | |
78 | * | |
79 | * @var boolean | |
80 | */ | |
81 | static $_log = true; | |
82 | /** | |
83 | * | |
84 | * @var int unsigned | |
85 | */ | |
86 | public $id; | |
87 | /** | |
88 | * The meta name for this date (fixed in code) | |
89 | * | |
90 | * @var string | |
91 | */ | |
92 | public $name; | |
93 | /** | |
94 | * Description of this date type. | |
95 | * | |
96 | * @var string | |
97 | */ | |
98 | public $description; | |
99 | /** | |
100 | * The start offset relative to current year | |
101 | * | |
102 | * @var int | |
103 | */ | |
104 | public $start; | |
105 | /** | |
106 | * The end offset relative to current year, can be negative | |
107 | * | |
108 | * @var int | |
109 | */ | |
110 | public $end; | |
111 | /** | |
112 | * The date type | |
113 | * | |
114 | * @var string | |
115 | */ | |
116 | public $date_format; | |
117 | /** | |
118 | * time format | |
119 | * | |
120 | * @var string | |
121 | */ | |
122 | public $time_format; | |
123 | /** | |
124 | * class constructor | |
125 | * | |
126 | * @return civicrm_preferences_date | |
127 | */ | |
128 | function __construct() { | |
129 | $this->__table = 'civicrm_preferences_date'; | |
130 | parent::__construct(); | |
131 | } | |
132 | /** | |
133 | * Returns all the column names of this table | |
134 | * | |
135 | * @return array | |
136 | */ | |
137 | static function &fields() { | |
138 | if (!(self::$_fields)) { | |
139 | self::$_fields = array( | |
140 | 'id' => array( | |
141 | 'name' => 'id', | |
142 | 'type' => CRM_Utils_Type::T_INT, | |
143 | 'required' => true, | |
144 | ) , | |
145 | 'name' => array( | |
146 | 'name' => 'name', | |
147 | 'type' => CRM_Utils_Type::T_STRING, | |
148 | 'title' => ts('Name') , | |
149 | 'description' => 'The meta name for this date (fixed in code)', | |
150 | 'required' => true, | |
151 | 'maxlength' => 64, | |
152 | 'size' => CRM_Utils_Type::BIG, | |
153 | ) , | |
154 | 'description' => array( | |
155 | 'name' => 'description', | |
156 | 'type' => CRM_Utils_Type::T_STRING, | |
157 | 'title' => ts('Description') , | |
158 | 'description' => 'Description of this date type.', | |
159 | 'maxlength' => 255, | |
160 | 'size' => CRM_Utils_Type::HUGE, | |
161 | ) , | |
162 | 'start' => array( | |
163 | 'name' => 'start', | |
164 | 'type' => CRM_Utils_Type::T_INT, | |
165 | 'title' => ts('Start') , | |
166 | 'description' => 'The start offset relative to current year', | |
167 | 'required' => true, | |
168 | ) , | |
169 | 'end' => array( | |
170 | 'name' => 'end', | |
171 | 'type' => CRM_Utils_Type::T_INT, | |
172 | 'title' => ts('End') , | |
173 | 'description' => 'The end offset relative to current year, can be negative', | |
174 | 'required' => true, | |
175 | ) , | |
176 | 'date_format' => array( | |
177 | 'name' => 'date_format', | |
178 | 'type' => CRM_Utils_Type::T_STRING, | |
179 | 'title' => ts('Date Format') , | |
180 | 'description' => 'The date type', | |
181 | 'maxlength' => 64, | |
182 | 'size' => CRM_Utils_Type::BIG, | |
183 | ) , | |
184 | 'time_format' => array( | |
185 | 'name' => 'time_format', | |
186 | 'type' => CRM_Utils_Type::T_STRING, | |
187 | 'title' => ts('Time Format') , | |
188 | 'description' => 'time format', | |
189 | 'maxlength' => 64, | |
190 | 'size' => CRM_Utils_Type::BIG, | |
191 | ) , | |
192 | ); | |
193 | } | |
194 | return self::$_fields; | |
195 | } | |
196 | /** | |
197 | * Returns an array containing, for each field, the arary key used for that | |
198 | * field in self::$_fields. | |
199 | * | |
200 | * @return array | |
201 | */ | |
202 | static function &fieldKeys() { | |
203 | if (!(self::$_fieldKeys)) { | |
204 | self::$_fieldKeys = array( | |
205 | 'id' => 'id', | |
206 | 'name' => 'name', | |
207 | 'description' => 'description', | |
208 | 'start' => 'start', | |
209 | 'end' => 'end', | |
210 | 'date_format' => 'date_format', | |
211 | 'time_format' => 'time_format', | |
212 | ); | |
213 | } | |
214 | return self::$_fieldKeys; | |
215 | } | |
216 | /** | |
217 | * Returns the names of this table | |
218 | * | |
219 | * @return string | |
220 | */ | |
221 | static function getTableName() { | |
222 | return self::$_tableName; | |
223 | } | |
224 | /** | |
225 | * Returns if this table needs to be logged | |
226 | * | |
227 | * @return boolean | |
228 | */ | |
229 | function getLog() { | |
230 | return self::$_log; | |
231 | } | |
232 | /** | |
233 | * Returns the list of fields that can be imported | |
234 | * | |
235 | * @param bool $prefix | |
236 | * | |
237 | * @return array | |
238 | */ | |
239 | static function &import($prefix = false) { | |
240 | if (!(self::$_import)) { | |
241 | self::$_import = array(); | |
242 | $fields = self::fields(); | |
243 | foreach($fields as $name => $field) { | |
244 | if (CRM_Utils_Array::value('import', $field)) { | |
245 | if ($prefix) { | |
246 | self::$_import['preferences_date'] = & $fields[$name]; | |
247 | } else { | |
248 | self::$_import[$name] = & $fields[$name]; | |
249 | } | |
250 | } | |
251 | } | |
252 | } | |
253 | return self::$_import; | |
254 | } | |
255 | /** | |
256 | * Returns the list of fields that can be exported | |
257 | * | |
258 | * @param bool $prefix | |
259 | * | |
260 | * @return array | |
261 | */ | |
262 | static function &export($prefix = false) { | |
263 | if (!(self::$_export)) { | |
264 | self::$_export = array(); | |
265 | $fields = self::fields(); | |
266 | foreach($fields as $name => $field) { | |
267 | if (CRM_Utils_Array::value('export', $field)) { | |
268 | if ($prefix) { | |
269 | self::$_export['preferences_date'] = & $fields[$name]; | |
270 | } else { | |
271 | self::$_export[$name] = & $fields[$name]; | |
272 | } | |
273 | } | |
274 | } | |
275 | } | |
276 | return self::$_export; | |
277 | } | |
278 | } |