Define gettext translation for world_region
[civicrm-core.git] / CRM / Core / DAO / Timezone.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/Timezone.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e380ee3b 9 * (GenCodeChecksum:e54363ef08090c4dfbed076c842edd03)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Timezone entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_Timezone extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_timezone';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b
TO
31 /**
32 * Timezone Id
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * Timezone full name
40 *
41 * @var string
42 */
43 public $name;
c3fc2621 44
e501603b
TO
45 /**
46 * ISO Code for timezone abbreviation
47 *
48 * @var string
49 */
50 public $abbreviation;
c3fc2621 51
e501603b
TO
52 /**
53 * GMT name of the timezone
54 *
55 * @var string
56 */
57 public $gmt;
c3fc2621 58
e501603b 59 /**
e501603b
TO
60 * @var int
61 */
62 public $offset;
c3fc2621 63
e501603b
TO
64 /**
65 * Country Id
66 *
67 * @var int unsigned
68 */
69 public $country_id;
c3fc2621 70
e501603b 71 /**
f41f0342 72 * Class constructor.
e501603b 73 */
c3fc2621 74 public function __construct() {
e501603b
TO
75 $this->__table = 'civicrm_timezone';
76 parent::__construct();
77 }
c3fc2621 78
e501603b 79 /**
f41f0342 80 * Returns foreign keys and entity references.
e501603b
TO
81 *
82 * @return array
83 * [CRM_Core_Reference_Interface]
84 */
c3fc2621 85 public static function getReferenceColumns() {
346aaaba
TO
86 if (!isset(Civi::$statics[__CLASS__]['links'])) {
87 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
c3fc2621 88 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'country_id', 'civicrm_country', 'id');
346aaaba 89 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 90 }
346aaaba 91 return Civi::$statics[__CLASS__]['links'];
e501603b 92 }
c3fc2621 93
e501603b
TO
94 /**
95 * Returns all the column names of this table
96 *
97 * @return array
98 */
c3fc2621 99 public static function &fields() {
346aaaba 100 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
101 Civi::$statics[__CLASS__]['fields'] = [
102 'id' => [
e501603b
TO
103 'name' => 'id',
104 'type' => CRM_Utils_Type::T_INT,
c3fc2621 105 'title' => ts('Timezone ID'),
215b423e 106 'description' => ts('Timezone Id'),
c3fc2621 107 'required' => TRUE,
522a26c9 108 'table_name' => 'civicrm_timezone',
109 'entity' => 'Timezone',
110 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 111 'localizable' => 0,
c3fc2621
CW
112 ],
113 'name' => [
e501603b
TO
114 'name' => 'name',
115 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 116 'title' => ts('Timezone Name'),
215b423e 117 'description' => ts('Timezone full name'),
e501603b
TO
118 'maxlength' => 64,
119 'size' => CRM_Utils_Type::BIG,
522a26c9 120 'table_name' => 'civicrm_timezone',
121 'entity' => 'Timezone',
122 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 123 'localizable' => 0,
c3fc2621
CW
124 ],
125 'abbreviation' => [
e501603b
TO
126 'name' => 'abbreviation',
127 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 128 'title' => ts('Timezone Abbreviation'),
215b423e 129 'description' => ts('ISO Code for timezone abbreviation'),
e501603b
TO
130 'maxlength' => 3,
131 'size' => CRM_Utils_Type::FOUR,
522a26c9 132 'table_name' => 'civicrm_timezone',
133 'entity' => 'Timezone',
134 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 135 'localizable' => 0,
c3fc2621
CW
136 ],
137 'gmt' => [
e501603b
TO
138 'name' => 'gmt',
139 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 140 'title' => ts('GMT Name of Timezone'),
215b423e 141 'description' => ts('GMT name of the timezone'),
e501603b
TO
142 'maxlength' => 64,
143 'size' => CRM_Utils_Type::BIG,
522a26c9 144 'table_name' => 'civicrm_timezone',
145 'entity' => 'Timezone',
146 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 147 'localizable' => 0,
c3fc2621
CW
148 ],
149 'offset' => [
e501603b
TO
150 'name' => 'offset',
151 'type' => CRM_Utils_Type::T_INT,
c3fc2621 152 'title' => ts('GMT Offset'),
522a26c9 153 'table_name' => 'civicrm_timezone',
154 'entity' => 'Timezone',
155 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 156 'localizable' => 0,
c3fc2621
CW
157 ],
158 'country_id' => [
e501603b
TO
159 'name' => 'country_id',
160 'type' => CRM_Utils_Type::T_INT,
c3fc2621 161 'title' => ts('Country'),
215b423e 162 'description' => ts('Country Id'),
c3fc2621 163 'required' => TRUE,
522a26c9 164 'table_name' => 'civicrm_timezone',
165 'entity' => 'Timezone',
166 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 167 'localizable' => 0,
e501603b 168 'FKClassName' => 'CRM_Core_DAO_Country',
c3fc2621
CW
169 ],
170 ];
346aaaba 171 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 172 }
346aaaba 173 return Civi::$statics[__CLASS__]['fields'];
e501603b 174 }
c3fc2621 175
e501603b 176 /**
bd8e0b14 177 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
178 *
179 * @return array
bd8e0b14 180 * Array(string $name => string $uniqueName).
e501603b 181 */
c3fc2621 182 public static function &fieldKeys() {
bd8e0b14
TO
183 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
184 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 185 }
bd8e0b14 186 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 187 }
c3fc2621 188
e501603b
TO
189 /**
190 * Returns the names of this table
191 *
192 * @return string
193 */
c3fc2621 194 public static function getTableName() {
e501603b
TO
195 return self::$_tableName;
196 }
c3fc2621 197
e501603b
TO
198 /**
199 * Returns if this table needs to be logged
200 *
c3fc2621 201 * @return bool
e501603b 202 */
c3fc2621 203 public function getLog() {
e501603b
TO
204 return self::$_log;
205 }
c3fc2621 206
e501603b
TO
207 /**
208 * Returns the list of fields that can be imported
209 *
210 * @param bool $prefix
211 *
212 * @return array
213 */
c3fc2621
CW
214 public static function &import($prefix = FALSE) {
215 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'timezone', $prefix, []);
60808919 216 return $r;
e501603b 217 }
c3fc2621 218
e501603b
TO
219 /**
220 * Returns the list of fields that can be exported
221 *
222 * @param bool $prefix
223 *
224 * @return array
225 */
c3fc2621
CW
226 public static function &export($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'timezone', $prefix, []);
60808919 228 return $r;
e501603b 229 }
c3fc2621 230
e7a6b91a
AS
231 /**
232 * Returns the list of indices
c3fc2621
CW
233 *
234 * @param bool $localize
235 *
236 * @return array
e7a6b91a
AS
237 */
238 public static function indices($localize = TRUE) {
c3fc2621 239 $indices = [];
e7a6b91a
AS
240 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
241 }
c3fc2621 242
e501603b 243}