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:0c8797659c05f81eb6f2f2589b5baee4)
13 * Database access object for the Timezone entity.
15 class CRM_Core_DAO_Timezone
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_timezone';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
46 * ISO Code for timezone abbreviation
53 * GMT name of the timezone
74 public function __construct() {
75 $this->__table
= 'civicrm_timezone';
76 parent
::__construct();
80 * Returns localized title of this entity.
82 public static function getEntityTitle() {
83 return ts('Timezones');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'country_id', 'civicrm_country', 'id');
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
98 return Civi
::$statics[__CLASS__
]['links'];
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Timezone ID'),
113 'description' => ts('Timezone Id'),
115 'where' => 'civicrm_timezone.id',
116 'table_name' => 'civicrm_timezone',
117 'entity' => 'Timezone',
118 'bao' => 'CRM_Core_DAO_Timezone',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Timezone Name'),
125 'description' => ts('Timezone full name'),
127 'size' => CRM_Utils_Type
::BIG
,
128 'where' => 'civicrm_timezone.name',
129 'table_name' => 'civicrm_timezone',
130 'entity' => 'Timezone',
131 'bao' => 'CRM_Core_DAO_Timezone',
135 'name' => 'abbreviation',
136 'type' => CRM_Utils_Type
::T_STRING
,
137 'title' => ts('Timezone Abbreviation'),
138 'description' => ts('ISO Code for timezone abbreviation'),
140 'size' => CRM_Utils_Type
::FOUR
,
141 'where' => 'civicrm_timezone.abbreviation',
142 'table_name' => 'civicrm_timezone',
143 'entity' => 'Timezone',
144 'bao' => 'CRM_Core_DAO_Timezone',
149 'type' => CRM_Utils_Type
::T_STRING
,
150 'title' => ts('GMT Name of Timezone'),
151 'description' => ts('GMT name of the timezone'),
153 'size' => CRM_Utils_Type
::BIG
,
154 'where' => 'civicrm_timezone.gmt',
155 'table_name' => 'civicrm_timezone',
156 'entity' => 'Timezone',
157 'bao' => 'CRM_Core_DAO_Timezone',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('GMT Offset'),
164 'where' => 'civicrm_timezone.offset',
165 'table_name' => 'civicrm_timezone',
166 'entity' => 'Timezone',
167 'bao' => 'CRM_Core_DAO_Timezone',
171 'name' => 'country_id',
172 'type' => CRM_Utils_Type
::T_INT
,
173 'title' => ts('Country'),
174 'description' => ts('Country Id'),
176 'where' => 'civicrm_timezone.country_id',
177 'table_name' => 'civicrm_timezone',
178 'entity' => 'Timezone',
179 'bao' => 'CRM_Core_DAO_Timezone',
181 'FKClassName' => 'CRM_Core_DAO_Country',
184 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
186 return Civi
::$statics[__CLASS__
]['fields'];
190 * Return a mapping from field-name to the corresponding key (as used in fields()).
193 * Array(string $name => string $uniqueName).
195 public static function &fieldKeys() {
196 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
197 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
199 return Civi
::$statics[__CLASS__
]['fieldKeys'];
203 * Returns the names of this table
207 public static function getTableName() {
208 return self
::$_tableName;
212 * Returns if this table needs to be logged
216 public function getLog() {
221 * Returns the list of fields that can be imported
223 * @param bool $prefix
227 public static function &import($prefix = FALSE) {
228 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
233 * Returns the list of fields that can be exported
235 * @param bool $prefix
239 public static function &export($prefix = FALSE) {
240 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
245 * Returns the list of indices
247 * @param bool $localize
251 public static function indices($localize = TRUE) {
253 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;