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