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:a1960975c14d40dedac3cbf6121044db)
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;
48 * ISO Code for timezone abbreviation
55 * GMT name of the timezone
76 public function __construct() {
77 $this->__table
= 'civicrm_timezone';
78 parent
::__construct();
82 * Returns localized title of this entity.
85 * Whether to return the plural version of the title.
87 public static function getEntityTitle($plural = FALSE) {
88 return $plural ?
ts('Timezones') : ts('Timezone');
92 * Returns foreign keys and entity references.
95 * [CRM_Core_Reference_Interface]
97 public static function getReferenceColumns() {
98 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
99 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
100 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'country_id', 'civicrm_country', 'id');
101 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
103 return Civi
::$statics[__CLASS__
]['links'];
107 * Returns all the column names of this table
111 public static function &fields() {
112 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
113 Civi
::$statics[__CLASS__
]['fields'] = [
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Timezone ID'),
118 'description' => ts('Timezone ID'),
120 'where' => 'civicrm_timezone.id',
121 'table_name' => 'civicrm_timezone',
122 'entity' => 'Timezone',
123 'bao' => 'CRM_Core_DAO_Timezone',
133 'type' => CRM_Utils_Type
::T_STRING
,
134 'title' => ts('Timezone Name'),
135 'description' => ts('Timezone full name'),
137 'size' => CRM_Utils_Type
::BIG
,
138 'where' => 'civicrm_timezone.name',
139 'table_name' => 'civicrm_timezone',
140 'entity' => 'Timezone',
141 'bao' => 'CRM_Core_DAO_Timezone',
146 'name' => 'abbreviation',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Timezone Abbreviation'),
149 'description' => ts('ISO Code for timezone abbreviation'),
151 'size' => CRM_Utils_Type
::FOUR
,
152 'where' => 'civicrm_timezone.abbreviation',
153 'table_name' => 'civicrm_timezone',
154 'entity' => 'Timezone',
155 'bao' => 'CRM_Core_DAO_Timezone',
161 'type' => CRM_Utils_Type
::T_STRING
,
162 'title' => ts('GMT Name of Timezone'),
163 'description' => ts('GMT name of the timezone'),
165 'size' => CRM_Utils_Type
::BIG
,
166 'where' => 'civicrm_timezone.gmt',
167 'table_name' => 'civicrm_timezone',
168 'entity' => 'Timezone',
169 'bao' => 'CRM_Core_DAO_Timezone',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('GMT Offset'),
177 'where' => 'civicrm_timezone.offset',
178 'table_name' => 'civicrm_timezone',
179 'entity' => 'Timezone',
180 'bao' => 'CRM_Core_DAO_Timezone',
185 'name' => 'country_id',
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('Country ID'),
188 'description' => ts('Country ID'),
190 'where' => 'civicrm_timezone.country_id',
191 'table_name' => 'civicrm_timezone',
192 'entity' => 'Timezone',
193 'bao' => 'CRM_Core_DAO_Timezone',
195 'FKClassName' => 'CRM_Core_DAO_Country',
197 'label' => ts("Country"),
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 * Array(string $name => string $uniqueName).
213 public static function &fieldKeys() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
215 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
217 return Civi
::$statics[__CLASS__
]['fieldKeys'];
221 * Returns the names of this table
225 public static function getTableName() {
226 return self
::$_tableName;
230 * Returns if this table needs to be logged
234 public function getLog() {
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
251 * Returns the list of fields that can be exported
253 * @param bool $prefix
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
263 * Returns the list of indices
265 * @param bool $localize
269 public static function indices($localize = TRUE) {
271 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;