CRM-14885 - Import DAO's
[civicrm-core.git] / CRM / Core / DAO / Timezone.php
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/Timezone.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:be63fa40c8b49d870a708348a633ed58)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Timezone extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_timezone';
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 = false;
83 /**
84 * Timezone Id
85 *
86 * @var int unsigned
87 */
88 public $id;
89 /**
90 * Timezone full name
91 *
92 * @var string
93 */
94 public $name;
95 /**
96 * ISO Code for timezone abbreviation
97 *
98 * @var string
99 */
100 public $abbreviation;
101 /**
102 * GMT name of the timezone
103 *
104 * @var string
105 */
106 public $gmt;
107 /**
108 *
109 * @var int
110 */
111 public $offset;
112 /**
113 * Country Id
114 *
115 * @var int unsigned
116 */
117 public $country_id;
118 /**
119 * class constructor
120 *
121 * @return civicrm_timezone
122 */
123 function __construct() {
124 $this->__table = 'civicrm_timezone';
125 parent::__construct();
126 }
127 /**
128 * Returns foreign keys and entity references
129 *
130 * @return array
131 * [CRM_Core_Reference_Interface]
132 */
133 static function getReferenceColumns() {
134 if (!self::$_links) {
135 self::$_links = static ::createReferenceColumns(__CLASS__);
136 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'country_id', 'civicrm_country', 'id');
137 }
138 return self::$_links;
139 }
140 /**
141 * Returns all the column names of this table
142 *
143 * @return array
144 */
145 static function &fields() {
146 if (!(self::$_fields)) {
147 self::$_fields = array(
148 'id' => array(
149 'name' => 'id',
150 'type' => CRM_Utils_Type::T_INT,
151 'title' => ts('Timezone ID') ,
152 'description' => 'Timezone Id',
153 'required' => true,
154 ) ,
155 'name' => array(
156 'name' => 'name',
157 'type' => CRM_Utils_Type::T_STRING,
158 'title' => ts('Timezone Name') ,
159 'description' => 'Timezone full name',
160 'maxlength' => 64,
161 'size' => CRM_Utils_Type::BIG,
162 ) ,
163 'abbreviation' => array(
164 'name' => 'abbreviation',
165 'type' => CRM_Utils_Type::T_STRING,
166 'title' => ts('Timezone Abbreviation') ,
167 'description' => 'ISO Code for timezone abbreviation',
168 'maxlength' => 3,
169 'size' => CRM_Utils_Type::FOUR,
170 ) ,
171 'gmt' => array(
172 'name' => 'gmt',
173 'type' => CRM_Utils_Type::T_STRING,
174 'title' => ts('GMT Name of Timezone') ,
175 'description' => 'GMT name of the timezone',
176 'maxlength' => 64,
177 'size' => CRM_Utils_Type::BIG,
178 ) ,
179 'offset' => array(
180 'name' => 'offset',
181 'type' => CRM_Utils_Type::T_INT,
182 'title' => ts('GMT Offset') ,
183 ) ,
184 'country_id' => array(
185 'name' => 'country_id',
186 'type' => CRM_Utils_Type::T_INT,
187 'title' => ts('Country') ,
188 'description' => 'Country Id',
189 'required' => true,
190 'FKClassName' => 'CRM_Core_DAO_Country',
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 'abbreviation' => 'abbreviation',
208 'gmt' => 'gmt',
209 'offset' => 'offset',
210 'country_id' => 'country_id',
211 );
212 }
213 return self::$_fieldKeys;
214 }
215 /**
216 * Returns the names of this table
217 *
218 * @return string
219 */
220 static function getTableName() {
221 return self::$_tableName;
222 }
223 /**
224 * Returns if this table needs to be logged
225 *
226 * @return boolean
227 */
228 function getLog() {
229 return self::$_log;
230 }
231 /**
232 * Returns the list of fields that can be imported
233 *
234 * @param bool $prefix
235 *
236 * @return array
237 */
238 static function &import($prefix = false) {
239 if (!(self::$_import)) {
240 self::$_import = array();
241 $fields = self::fields();
242 foreach($fields as $name => $field) {
243 if (CRM_Utils_Array::value('import', $field)) {
244 if ($prefix) {
245 self::$_import['timezone'] = & $fields[$name];
246 } else {
247 self::$_import[$name] = & $fields[$name];
248 }
249 }
250 }
251 }
252 return self::$_import;
253 }
254 /**
255 * Returns the list of fields that can be exported
256 *
257 * @param bool $prefix
258 *
259 * @return array
260 */
261 static function &export($prefix = false) {
262 if (!(self::$_export)) {
263 self::$_export = array();
264 $fields = self::fields();
265 foreach($fields as $name => $field) {
266 if (CRM_Utils_Array::value('export', $field)) {
267 if ($prefix) {
268 self::$_export['timezone'] = & $fields[$name];
269 } else {
270 self::$_export[$name] = & $fields[$name];
271 }
272 }
273 }
274 }
275 return self::$_export;
276 }
277 }