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:fc76675346aa5a97d5ce798b9968ee58)
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',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Timezone Name'),
126 'description' => ts('Timezone full name'),
128 'size' => CRM_Utils_Type
::BIG
,
129 'where' => 'civicrm_timezone.name',
130 'table_name' => 'civicrm_timezone',
131 'entity' => 'Timezone',
132 'bao' => 'CRM_Core_DAO_Timezone',
137 'name' => 'abbreviation',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Timezone Abbreviation'),
140 'description' => ts('ISO Code for timezone abbreviation'),
142 'size' => CRM_Utils_Type
::FOUR
,
143 'where' => 'civicrm_timezone.abbreviation',
144 'table_name' => 'civicrm_timezone',
145 'entity' => 'Timezone',
146 'bao' => 'CRM_Core_DAO_Timezone',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('GMT Name of Timezone'),
154 'description' => ts('GMT name of the timezone'),
156 'size' => CRM_Utils_Type
::BIG
,
157 'where' => 'civicrm_timezone.gmt',
158 'table_name' => 'civicrm_timezone',
159 'entity' => 'Timezone',
160 'bao' => 'CRM_Core_DAO_Timezone',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('GMT Offset'),
168 'where' => 'civicrm_timezone.offset',
169 'table_name' => 'civicrm_timezone',
170 'entity' => 'Timezone',
171 'bao' => 'CRM_Core_DAO_Timezone',
176 'name' => 'country_id',
177 'type' => CRM_Utils_Type
::T_INT
,
178 'title' => ts('Country'),
179 'description' => ts('Country Id'),
181 'where' => 'civicrm_timezone.country_id',
182 'table_name' => 'civicrm_timezone',
183 'entity' => 'Timezone',
184 'bao' => 'CRM_Core_DAO_Timezone',
186 'FKClassName' => 'CRM_Core_DAO_Country',
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
192 return Civi
::$statics[__CLASS__
]['fields'];
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
199 * Array(string $name => string $uniqueName).
201 public static function &fieldKeys() {
202 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
203 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
205 return Civi
::$statics[__CLASS__
]['fieldKeys'];
209 * Returns the names of this table
213 public static function getTableName() {
214 return self
::$_tableName;
218 * Returns if this table needs to be logged
222 public function getLog() {
227 * Returns the list of fields that can be imported
229 * @param bool $prefix
233 public static function &import($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
239 * Returns the list of fields that can be exported
241 * @param bool $prefix
245 public static function &export($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
251 * Returns the list of indices
253 * @param bool $localize
257 public static function indices($localize = TRUE) {
259 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;