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:59621b636915c317561204de52299004)
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 localized title of this entity.
89 public static function getEntityTitle() {
90 return ts('Preferences Dates');
94 * Returns all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Date Preference ID'),
106 'where' => 'civicrm_preferences_date.id',
107 'table_name' => 'civicrm_preferences_date',
108 'entity' => 'PreferencesDate',
109 'bao' => 'CRM_Core_BAO_PreferencesDate',
114 'type' => CRM_Utils_Type
::T_STRING
,
115 'title' => ts('Date Preference Name'),
116 'description' => ts('The meta name for this date (fixed in code)'),
119 'size' => CRM_Utils_Type
::BIG
,
120 'where' => 'civicrm_preferences_date.name',
121 'table_name' => 'civicrm_preferences_date',
122 'entity' => 'PreferencesDate',
123 'bao' => 'CRM_Core_BAO_PreferencesDate',
127 'name' => 'description',
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Description'),
130 'description' => ts('Description of this date type.'),
132 'size' => CRM_Utils_Type
::HUGE
,
133 'where' => 'civicrm_preferences_date.description',
134 'table_name' => 'civicrm_preferences_date',
135 'entity' => 'PreferencesDate',
136 'bao' => 'CRM_Core_BAO_PreferencesDate',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Start'),
143 'description' => ts('The start offset relative to current year'),
145 'where' => 'civicrm_preferences_date.start',
146 'table_name' => 'civicrm_preferences_date',
147 'entity' => 'PreferencesDate',
148 'bao' => 'CRM_Core_BAO_PreferencesDate',
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('End Offset'),
155 'description' => ts('The end offset relative to current year, can be negative'),
157 'where' => 'civicrm_preferences_date.end',
158 'table_name' => 'civicrm_preferences_date',
159 'entity' => 'PreferencesDate',
160 'bao' => 'CRM_Core_BAO_PreferencesDate',
164 'name' => 'date_format',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Date Format'),
167 'description' => ts('The date type'),
169 'size' => CRM_Utils_Type
::BIG
,
170 'where' => 'civicrm_preferences_date.date_format',
171 'table_name' => 'civicrm_preferences_date',
172 'entity' => 'PreferencesDate',
173 'bao' => 'CRM_Core_BAO_PreferencesDate',
177 'name' => 'time_format',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Time Format'),
180 'description' => ts('time format'),
182 'size' => CRM_Utils_Type
::BIG
,
183 'where' => 'civicrm_preferences_date.time_format',
184 'table_name' => 'civicrm_preferences_date',
185 'entity' => 'PreferencesDate',
186 'bao' => 'CRM_Core_BAO_PreferencesDate',
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
192 return Civi
::$statics[__CLASS__
]['fields'];
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
199 * Array(string $name => string $uniqueName).
201 public static function &fieldKeys() {
202 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
203 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
205 return Civi
::$statics[__CLASS__
]['fieldKeys'];
209 * Returns the names of this table
213 public static function getTableName() {
214 return self
::$_tableName;
218 * Returns if this table needs to be logged
222 public function getLog() {
227 * Returns the list of fields that can be imported
229 * @param bool $prefix
233 public static function &import($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
239 * Returns the list of fields that can be exported
241 * @param bool $prefix
245 public static function &export($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
251 * Returns the list of indices
253 * @param bool $localize
257 public static function indices($localize = TRUE) {
260 'name' => 'index_name',
264 'localizable' => FALSE,
265 'sig' => 'civicrm_preferences_date::0::name',
268 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;