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:b49b5541f20c732fc7ff4cdc3687899b)
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',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Timezone Name'),
131 'description' => ts('Timezone full name'),
133 'size' => CRM_Utils_Type
::BIG
,
134 'where' => 'civicrm_timezone.name',
135 'table_name' => 'civicrm_timezone',
136 'entity' => 'Timezone',
137 'bao' => 'CRM_Core_DAO_Timezone',
142 'name' => 'abbreviation',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('Timezone Abbreviation'),
145 'description' => ts('ISO Code for timezone abbreviation'),
147 'size' => CRM_Utils_Type
::FOUR
,
148 'where' => 'civicrm_timezone.abbreviation',
149 'table_name' => 'civicrm_timezone',
150 'entity' => 'Timezone',
151 'bao' => 'CRM_Core_DAO_Timezone',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('GMT Name of Timezone'),
159 'description' => ts('GMT name of the timezone'),
161 'size' => CRM_Utils_Type
::BIG
,
162 'where' => 'civicrm_timezone.gmt',
163 'table_name' => 'civicrm_timezone',
164 'entity' => 'Timezone',
165 'bao' => 'CRM_Core_DAO_Timezone',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('GMT Offset'),
173 'where' => 'civicrm_timezone.offset',
174 'table_name' => 'civicrm_timezone',
175 'entity' => 'Timezone',
176 'bao' => 'CRM_Core_DAO_Timezone',
181 'name' => 'country_id',
182 'type' => CRM_Utils_Type
::T_INT
,
183 'title' => ts('Country'),
184 'description' => ts('Country Id'),
186 'where' => 'civicrm_timezone.country_id',
187 'table_name' => 'civicrm_timezone',
188 'entity' => 'Timezone',
189 'bao' => 'CRM_Core_DAO_Timezone',
191 'FKClassName' => 'CRM_Core_DAO_Country',
195 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
197 return Civi
::$statics[__CLASS__
]['fields'];
201 * Return a mapping from field-name to the corresponding key (as used in fields()).
204 * Array(string $name => string $uniqueName).
206 public static function &fieldKeys() {
207 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
208 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
210 return Civi
::$statics[__CLASS__
]['fieldKeys'];
214 * Returns the names of this table
218 public static function getTableName() {
219 return self
::$_tableName;
223 * Returns if this table needs to be logged
227 public function getLog() {
232 * Returns the list of fields that can be imported
234 * @param bool $prefix
238 public static function &import($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'timezone', $prefix, []);
244 * Returns the list of fields that can be exported
246 * @param bool $prefix
250 public static function &export($prefix = FALSE) {
251 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'timezone', $prefix, []);
256 * Returns the list of indices
258 * @param bool $localize
262 public static function indices($localize = TRUE) {
264 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;