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:e950a7985ee12a8b5ec6e926e8a49b20)
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',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Date Preference Name'),
117 'description' => ts('The meta name for this date (fixed in code)'),
120 'size' => CRM_Utils_Type
::BIG
,
121 'where' => 'civicrm_preferences_date.name',
122 'table_name' => 'civicrm_preferences_date',
123 'entity' => 'PreferencesDate',
124 'bao' => 'CRM_Core_BAO_PreferencesDate',
129 'name' => 'description',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Description'),
132 'description' => ts('Description of this date type.'),
134 'size' => CRM_Utils_Type
::HUGE
,
135 'where' => 'civicrm_preferences_date.description',
136 'table_name' => 'civicrm_preferences_date',
137 'entity' => 'PreferencesDate',
138 'bao' => 'CRM_Core_BAO_PreferencesDate',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Start'),
146 'description' => ts('The start offset relative to current year'),
148 'where' => 'civicrm_preferences_date.start',
149 'table_name' => 'civicrm_preferences_date',
150 'entity' => 'PreferencesDate',
151 'bao' => 'CRM_Core_BAO_PreferencesDate',
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('End Offset'),
159 'description' => ts('The end offset relative to current year, can be negative'),
161 'where' => 'civicrm_preferences_date.end',
162 'table_name' => 'civicrm_preferences_date',
163 'entity' => 'PreferencesDate',
164 'bao' => 'CRM_Core_BAO_PreferencesDate',
169 'name' => 'date_format',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Date Format'),
172 'description' => ts('The date type'),
174 'size' => CRM_Utils_Type
::BIG
,
175 'where' => 'civicrm_preferences_date.date_format',
176 'table_name' => 'civicrm_preferences_date',
177 'entity' => 'PreferencesDate',
178 'bao' => 'CRM_Core_BAO_PreferencesDate',
183 'name' => 'time_format',
184 'type' => CRM_Utils_Type
::T_STRING
,
185 'title' => ts('Time Format'),
186 'description' => ts('time format'),
188 'size' => CRM_Utils_Type
::BIG
,
189 'where' => 'civicrm_preferences_date.time_format',
190 'table_name' => 'civicrm_preferences_date',
191 'entity' => 'PreferencesDate',
192 'bao' => 'CRM_Core_BAO_PreferencesDate',
197 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
199 return Civi
::$statics[__CLASS__
]['fields'];
203 * Return a mapping from field-name to the corresponding key (as used in fields()).
206 * Array(string $name => string $uniqueName).
208 public static function &fieldKeys() {
209 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
210 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
212 return Civi
::$statics[__CLASS__
]['fieldKeys'];
216 * Returns the names of this table
220 public static function getTableName() {
221 return self
::$_tableName;
225 * Returns if this table needs to be logged
229 public function getLog() {
234 * Returns the list of fields that can be imported
236 * @param bool $prefix
240 public static function &import($prefix = FALSE) {
241 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
246 * Returns the list of fields that can be exported
248 * @param bool $prefix
252 public static function &export($prefix = FALSE) {
253 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
258 * Returns the list of indices
260 * @param bool $localize
264 public static function indices($localize = TRUE) {
267 'name' => 'index_name',
271 'localizable' => FALSE,
272 'sig' => 'civicrm_preferences_date::0::name',
275 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;