5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Timezone.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:bb3ae6e3a2a974f5a7e121a7ba763af6)
13 * Database access object for the Timezone entity.
15 class CRM_Core_DAO_Timezone
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.8';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_timezone';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * ISO Code for timezone abbreviation
56 * Note that values will be retrieved from the database as a string.
61 * GMT name of the timezone
64 * (SQL type: varchar(64))
65 * Note that values will be retrieved from the database as a string.
70 * @var int|string|null
72 * Note that values will be retrieved from the database as a string.
80 * (SQL type: int unsigned)
81 * Note that values will be retrieved from the database as a string.
88 public function __construct() {
89 $this->__table
= 'civicrm_timezone';
90 parent
::__construct();
94 * Returns localized title of this entity.
97 * Whether to return the plural version of the title.
99 public static function getEntityTitle($plural = FALSE) {
100 return $plural ?
ts('Timezones') : ts('Timezone');
104 * Returns foreign keys and entity references.
107 * [CRM_Core_Reference_Interface]
109 public static function getReferenceColumns() {
110 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
111 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
112 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'country_id', 'civicrm_country', 'id');
113 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
115 return Civi
::$statics[__CLASS__
]['links'];
119 * Returns all the column names of this table
123 public static function &fields() {
124 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
125 Civi
::$statics[__CLASS__
]['fields'] = [
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Timezone ID'),
130 'description' => ts('Timezone ID'),
132 'where' => 'civicrm_timezone.id',
133 'table_name' => 'civicrm_timezone',
134 'entity' => 'Timezone',
135 'bao' => 'CRM_Core_DAO_Timezone',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Timezone Name'),
147 'description' => ts('Timezone full name'),
149 'size' => CRM_Utils_Type
::BIG
,
150 'where' => 'civicrm_timezone.name',
151 'table_name' => 'civicrm_timezone',
152 'entity' => 'Timezone',
153 'bao' => 'CRM_Core_DAO_Timezone',
158 'name' => 'abbreviation',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Timezone Abbreviation'),
161 'description' => ts('ISO Code for timezone abbreviation'),
163 'size' => CRM_Utils_Type
::FOUR
,
164 'where' => 'civicrm_timezone.abbreviation',
165 'table_name' => 'civicrm_timezone',
166 'entity' => 'Timezone',
167 'bao' => 'CRM_Core_DAO_Timezone',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('GMT Name of Timezone'),
175 'description' => ts('GMT name of the timezone'),
177 'size' => CRM_Utils_Type
::BIG
,
178 'where' => 'civicrm_timezone.gmt',
179 'table_name' => 'civicrm_timezone',
180 'entity' => 'Timezone',
181 'bao' => 'CRM_Core_DAO_Timezone',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'title' => ts('GMT Offset'),
189 'where' => 'civicrm_timezone.offset',
190 'table_name' => 'civicrm_timezone',
191 'entity' => 'Timezone',
192 'bao' => 'CRM_Core_DAO_Timezone',
197 'name' => 'country_id',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Country ID'),
200 'description' => ts('Country ID'),
202 'where' => 'civicrm_timezone.country_id',
203 'table_name' => 'civicrm_timezone',
204 'entity' => 'Timezone',
205 'bao' => 'CRM_Core_DAO_Timezone',
207 'FKClassName' => 'CRM_Core_DAO_Country',
209 'label' => ts("Country"),
214 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
216 return Civi
::$statics[__CLASS__
]['fields'];
220 * Return a mapping from field-name to the corresponding key (as used in fields()).
223 * Array(string $name => string $uniqueName).
225 public static function &fieldKeys() {
226 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
227 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
229 return Civi
::$statics[__CLASS__
]['fieldKeys'];
233 * Returns the names of this table
237 public static function getTableName() {
238 return self
::$_tableName;
242 * Returns if this table needs to be logged
246 public function getLog() {
251 * Returns the list of fields that can be imported
253 * @param bool $prefix
257 public static function &import($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
263 * Returns the list of fields that can be exported
265 * @param bool $prefix
269 public static function &export($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
275 * Returns the list of indices
277 * @param bool $localize
281 public static function indices($localize = TRUE) {
283 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;