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:a48a49afa56a0c510fb1c05a41a62435)
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 foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'country_id', 'civicrm_country', 'id');
89 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
91 return Civi
::$statics[__CLASS__
]['links'];
95 * Returns all the column names of this table
99 public static function &fields() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
101 Civi
::$statics[__CLASS__
]['fields'] = [
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Timezone ID'),
106 'description' => ts('Timezone Id'),
108 'where' => 'civicrm_timezone.id',
109 'table_name' => 'civicrm_timezone',
110 'entity' => 'Timezone',
111 'bao' => 'CRM_Core_DAO_Timezone',
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Timezone Name'),
118 'description' => ts('Timezone full name'),
120 'size' => CRM_Utils_Type
::BIG
,
121 'where' => 'civicrm_timezone.name',
122 'table_name' => 'civicrm_timezone',
123 'entity' => 'Timezone',
124 'bao' => 'CRM_Core_DAO_Timezone',
128 'name' => 'abbreviation',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Timezone Abbreviation'),
131 'description' => ts('ISO Code for timezone abbreviation'),
133 'size' => CRM_Utils_Type
::FOUR
,
134 'where' => 'civicrm_timezone.abbreviation',
135 'table_name' => 'civicrm_timezone',
136 'entity' => 'Timezone',
137 'bao' => 'CRM_Core_DAO_Timezone',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('GMT Name of Timezone'),
144 'description' => ts('GMT name of the timezone'),
146 'size' => CRM_Utils_Type
::BIG
,
147 'where' => 'civicrm_timezone.gmt',
148 'table_name' => 'civicrm_timezone',
149 'entity' => 'Timezone',
150 'bao' => 'CRM_Core_DAO_Timezone',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('GMT Offset'),
157 'where' => 'civicrm_timezone.offset',
158 'table_name' => 'civicrm_timezone',
159 'entity' => 'Timezone',
160 'bao' => 'CRM_Core_DAO_Timezone',
164 'name' => 'country_id',
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Country'),
167 'description' => ts('Country Id'),
169 'where' => 'civicrm_timezone.country_id',
170 'table_name' => 'civicrm_timezone',
171 'entity' => 'Timezone',
172 'bao' => 'CRM_Core_DAO_Timezone',
174 'FKClassName' => 'CRM_Core_DAO_Country',
177 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
179 return Civi
::$statics[__CLASS__
]['fields'];
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 * Array(string $name => string $uniqueName).
188 public static function &fieldKeys() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
190 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
192 return Civi
::$statics[__CLASS__
]['fieldKeys'];
196 * Returns the names of this table
200 public static function getTableName() {
201 return self
::$_tableName;
205 * Returns if this table needs to be logged
209 public function getLog() {
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
226 * Returns the list of fields that can be exported
228 * @param bool $prefix
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
238 * Returns the list of indices
240 * @param bool $localize
244 public static function indices($localize = TRUE) {
246 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;