3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Core/Timezone.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_Timezone
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_timezone';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
95 * ISO Code for timezone abbreviation
101 * GMT name of the timezone
120 * @return civicrm_timezone
122 function __construct() {
123 $this->__table
= 'civicrm_timezone';
124 parent
::__construct();
127 * Returns foreign keys and entity references
130 * [CRM_Core_Reference_Interface]
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');
137 return self
::$_links;
140 * Returns all the column names of this table
144 static function &fields() {
145 if (!(self
::$_fields)) {
146 self
::$_fields = array(
149 'type' => CRM_Utils_Type
::T_INT
,
150 'description' => 'Timezone Id',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Name') ,
157 'description' => 'Timezone full name',
159 'size' => CRM_Utils_Type
::BIG
,
161 'abbreviation' => array(
162 'name' => 'abbreviation',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Abbreviation') ,
165 'description' => 'ISO Code for timezone abbreviation',
167 'size' => CRM_Utils_Type
::FOUR
,
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Gmt') ,
173 'description' => 'GMT name of the timezone',
175 'size' => CRM_Utils_Type
::BIG
,
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Offset') ,
182 'country_id' => array(
183 'name' => 'country_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'description' => 'Country Id',
187 'FKClassName' => 'CRM_Core_DAO_Country',
191 return self
::$_fields;
194 * Returns an array containing, for each field, the arary key used for that
195 * field in self::$_fields.
199 static function &fieldKeys() {
200 if (!(self
::$_fieldKeys)) {
201 self
::$_fieldKeys = array(
204 'abbreviation' => 'abbreviation',
206 'offset' => 'offset',
207 'country_id' => 'country_id',
210 return self
::$_fieldKeys;
213 * Returns the names of this table
217 static function getTableName() {
218 return self
::$_tableName;
221 * Returns if this table needs to be logged
229 * Returns the list of fields that can be imported
231 * @param bool $prefix
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)) {
242 self
::$_import['timezone'] = & $fields[$name];
244 self
::$_import[$name] = & $fields[$name];
249 return self
::$_import;
252 * Returns the list of fields that can be exported
254 * @param bool $prefix
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)) {
265 self
::$_export['timezone'] = & $fields[$name];
267 self
::$_export[$name] = & $fields[$name];
272 return self
::$_export;