(dev/core#959) Expose contribution page in Contribution Summary report
[civicrm-core.git] / CRM / Core / DAO / Timezone.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
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 */
fa45b5b9 22 public 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 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 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 86 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 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,
a36434b9 108 'where' => 'civicrm_timezone.id',
522a26c9 109 'table_name' => 'civicrm_timezone',
110 'entity' => 'Timezone',
111 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 112 'localizable' => 0,
c3fc2621
CW
113 ],
114 'name' => [
e501603b
TO
115 'name' => 'name',
116 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 117 'title' => ts('Timezone Name'),
215b423e 118 'description' => ts('Timezone full name'),
e501603b
TO
119 'maxlength' => 64,
120 'size' => CRM_Utils_Type::BIG,
a36434b9 121 'where' => 'civicrm_timezone.name',
522a26c9 122 'table_name' => 'civicrm_timezone',
123 'entity' => 'Timezone',
124 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 125 'localizable' => 0,
c3fc2621
CW
126 ],
127 'abbreviation' => [
e501603b
TO
128 'name' => 'abbreviation',
129 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 130 'title' => ts('Timezone Abbreviation'),
215b423e 131 'description' => ts('ISO Code for timezone abbreviation'),
e501603b
TO
132 'maxlength' => 3,
133 'size' => CRM_Utils_Type::FOUR,
a36434b9 134 'where' => 'civicrm_timezone.abbreviation',
522a26c9 135 'table_name' => 'civicrm_timezone',
136 'entity' => 'Timezone',
137 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 138 'localizable' => 0,
c3fc2621
CW
139 ],
140 'gmt' => [
e501603b
TO
141 'name' => 'gmt',
142 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 143 'title' => ts('GMT Name of Timezone'),
215b423e 144 'description' => ts('GMT name of the timezone'),
e501603b
TO
145 'maxlength' => 64,
146 'size' => CRM_Utils_Type::BIG,
a36434b9 147 'where' => 'civicrm_timezone.gmt',
522a26c9 148 'table_name' => 'civicrm_timezone',
149 'entity' => 'Timezone',
150 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 151 'localizable' => 0,
c3fc2621
CW
152 ],
153 'offset' => [
e501603b
TO
154 'name' => 'offset',
155 'type' => CRM_Utils_Type::T_INT,
c3fc2621 156 'title' => ts('GMT Offset'),
a36434b9 157 'where' => 'civicrm_timezone.offset',
522a26c9 158 'table_name' => 'civicrm_timezone',
159 'entity' => 'Timezone',
160 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 161 'localizable' => 0,
c3fc2621
CW
162 ],
163 'country_id' => [
e501603b
TO
164 'name' => 'country_id',
165 'type' => CRM_Utils_Type::T_INT,
c3fc2621 166 'title' => ts('Country'),
215b423e 167 'description' => ts('Country Id'),
c3fc2621 168 'required' => TRUE,
a36434b9 169 'where' => 'civicrm_timezone.country_id',
522a26c9 170 'table_name' => 'civicrm_timezone',
171 'entity' => 'Timezone',
172 'bao' => 'CRM_Core_DAO_Timezone',
6a7e5e5d 173 'localizable' => 0,
e501603b 174 'FKClassName' => 'CRM_Core_DAO_Country',
c3fc2621
CW
175 ],
176 ];
346aaaba 177 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 178 }
346aaaba 179 return Civi::$statics[__CLASS__]['fields'];
e501603b 180 }
c3fc2621 181
e501603b 182 /**
bd8e0b14 183 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
184 *
185 * @return array
bd8e0b14 186 * Array(string $name => string $uniqueName).
e501603b 187 */
c3fc2621 188 public static function &fieldKeys() {
bd8e0b14
TO
189 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
190 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 191 }
bd8e0b14 192 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 193 }
c3fc2621 194
e501603b
TO
195 /**
196 * Returns the names of this table
197 *
198 * @return string
199 */
c3fc2621 200 public static function getTableName() {
e501603b
TO
201 return self::$_tableName;
202 }
c3fc2621 203
e501603b
TO
204 /**
205 * Returns if this table needs to be logged
206 *
c3fc2621 207 * @return bool
e501603b 208 */
c3fc2621 209 public function getLog() {
e501603b
TO
210 return self::$_log;
211 }
c3fc2621 212
e501603b
TO
213 /**
214 * Returns the list of fields that can be imported
215 *
216 * @param bool $prefix
217 *
218 * @return array
219 */
c3fc2621
CW
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'timezone', $prefix, []);
60808919 222 return $r;
e501603b 223 }
c3fc2621 224
e501603b
TO
225 /**
226 * Returns the list of fields that can be exported
227 *
228 * @param bool $prefix
229 *
230 * @return array
231 */
c3fc2621
CW
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'timezone', $prefix, []);
60808919 234 return $r;
e501603b 235 }
c3fc2621 236
e7a6b91a
AS
237 /**
238 * Returns the list of indices
c3fc2621
CW
239 *
240 * @param bool $localize
241 *
242 * @return array
e7a6b91a
AS
243 */
244 public static function indices($localize = TRUE) {
c3fc2621 245 $indices = [];
e7a6b91a
AS
246 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
247 }
c3fc2621 248
e501603b 249}