5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/PreferencesDate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e24b6513a0604a340a896973ce8d2db2)
13 * Database access object for the PreferencesDate entity.
15 class CRM_Core_DAO_PreferencesDate
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_preferences_date';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
37 * The meta name for this date (fixed in code)
44 * Description of this date type.
51 * The start offset relative to current year
58 * The end offset relative to current year, can be negative
81 public function __construct() {
82 $this->__table
= 'civicrm_preferences_date';
83 parent
::__construct();
87 * Returns all the column names of this table
91 public static function &fields() {
92 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
93 Civi
::$statics[__CLASS__
]['fields'] = [
96 'type' => CRM_Utils_Type
::T_INT
,
97 'title' => ts('Date Preference ID'),
99 'where' => 'civicrm_preferences_date.id',
100 'table_name' => 'civicrm_preferences_date',
101 'entity' => 'PreferencesDate',
102 'bao' => 'CRM_Core_BAO_PreferencesDate',
107 'type' => CRM_Utils_Type
::T_STRING
,
108 'title' => ts('Date Preference Name'),
109 'description' => ts('The meta name for this date (fixed in code)'),
112 'size' => CRM_Utils_Type
::BIG
,
113 'where' => 'civicrm_preferences_date.name',
114 'table_name' => 'civicrm_preferences_date',
115 'entity' => 'PreferencesDate',
116 'bao' => 'CRM_Core_BAO_PreferencesDate',
120 'name' => 'description',
121 'type' => CRM_Utils_Type
::T_STRING
,
122 'title' => ts('Description'),
123 'description' => ts('Description of this date type.'),
125 'size' => CRM_Utils_Type
::HUGE
,
126 'where' => 'civicrm_preferences_date.description',
127 'table_name' => 'civicrm_preferences_date',
128 'entity' => 'PreferencesDate',
129 'bao' => 'CRM_Core_BAO_PreferencesDate',
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('Start'),
136 'description' => ts('The start offset relative to current year'),
138 'where' => 'civicrm_preferences_date.start',
139 'table_name' => 'civicrm_preferences_date',
140 'entity' => 'PreferencesDate',
141 'bao' => 'CRM_Core_BAO_PreferencesDate',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('End Offset'),
148 'description' => ts('The end offset relative to current year, can be negative'),
150 'where' => 'civicrm_preferences_date.end',
151 'table_name' => 'civicrm_preferences_date',
152 'entity' => 'PreferencesDate',
153 'bao' => 'CRM_Core_BAO_PreferencesDate',
157 'name' => 'date_format',
158 'type' => CRM_Utils_Type
::T_STRING
,
159 'title' => ts('Date Format'),
160 'description' => ts('The date type'),
162 'size' => CRM_Utils_Type
::BIG
,
163 'where' => 'civicrm_preferences_date.date_format',
164 'table_name' => 'civicrm_preferences_date',
165 'entity' => 'PreferencesDate',
166 'bao' => 'CRM_Core_BAO_PreferencesDate',
170 'name' => 'time_format',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Time Format'),
173 'description' => ts('time format'),
175 'size' => CRM_Utils_Type
::BIG
,
176 'where' => 'civicrm_preferences_date.time_format',
177 'table_name' => 'civicrm_preferences_date',
178 'entity' => 'PreferencesDate',
179 'bao' => 'CRM_Core_BAO_PreferencesDate',
183 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
185 return Civi
::$statics[__CLASS__
]['fields'];
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
192 * Array(string $name => string $uniqueName).
194 public static function &fieldKeys() {
195 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
196 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
198 return Civi
::$statics[__CLASS__
]['fieldKeys'];
202 * Returns the names of this table
206 public static function getTableName() {
207 return self
::$_tableName;
211 * Returns if this table needs to be logged
215 public function getLog() {
220 * Returns the list of fields that can be imported
222 * @param bool $prefix
226 public static function &import($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
232 * Returns the list of fields that can be exported
234 * @param bool $prefix
238 public static function &export($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
244 * Returns the list of indices
246 * @param bool $localize
250 public static function indices($localize = TRUE) {
253 'name' => 'index_name',
257 'localizable' => FALSE,
258 'sig' => 'civicrm_preferences_date::0::name',
261 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;