5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/Timezone.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0f44e0b7202cc3ace2ec6b7003fc941a)
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 static $_tableName = 'civicrm_timezone';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_timezone',
109 'entity' => 'Timezone',
110 'bao' => 'CRM_Core_DAO_Timezone',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Timezone Name'),
117 'description' => ts('Timezone full name'),
119 'size' => CRM_Utils_Type
::BIG
,
120 'table_name' => 'civicrm_timezone',
121 'entity' => 'Timezone',
122 'bao' => 'CRM_Core_DAO_Timezone',
126 'name' => 'abbreviation',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Timezone Abbreviation'),
129 'description' => ts('ISO Code for timezone abbreviation'),
131 'size' => CRM_Utils_Type
::FOUR
,
132 'table_name' => 'civicrm_timezone',
133 'entity' => 'Timezone',
134 'bao' => 'CRM_Core_DAO_Timezone',
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('GMT Name of Timezone'),
141 'description' => ts('GMT name of the timezone'),
143 'size' => CRM_Utils_Type
::BIG
,
144 'table_name' => 'civicrm_timezone',
145 'entity' => 'Timezone',
146 'bao' => 'CRM_Core_DAO_Timezone',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('GMT Offset'),
153 'table_name' => 'civicrm_timezone',
154 'entity' => 'Timezone',
155 'bao' => 'CRM_Core_DAO_Timezone',
159 'name' => 'country_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Country'),
162 'description' => ts('Country Id'),
164 'table_name' => 'civicrm_timezone',
165 'entity' => 'Timezone',
166 'bao' => 'CRM_Core_DAO_Timezone',
168 'FKClassName' => 'CRM_Core_DAO_Country',
171 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
173 return Civi
::$statics[__CLASS__
]['fields'];
177 * Return a mapping from field-name to the corresponding key (as used in fields()).
180 * Array(string $name => string $uniqueName).
182 public static function &fieldKeys() {
183 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
184 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
186 return Civi
::$statics[__CLASS__
]['fieldKeys'];
190 * Returns the names of this table
194 public static function getTableName() {
195 return self
::$_tableName;
199 * Returns if this table needs to be logged
203 public function getLog() {
208 * Returns the list of fields that can be imported
210 * @param bool $prefix
214 public static function &import($prefix = FALSE) {
215 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
220 * Returns the list of fields that can be exported
222 * @param bool $prefix
226 public static function &export($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
232 * Returns the list of indices
234 * @param bool $localize
238 public static function indices($localize = TRUE) {
240 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;