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:21383b05b8c8e98ed1721aab06031907)
13 * Database access object for the PreferencesDate entity.
15 class CRM_Core_DAO_PreferencesDate
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_preferences_date';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
39 * The meta name for this date (fixed in code)
46 * Description of this date type.
53 * The start offset relative to current year
60 * The end offset relative to current year, can be negative
83 public function __construct() {
84 $this->__table
= 'civicrm_preferences_date';
85 parent
::__construct();
89 * Returns localized title of this entity.
91 public static function getEntityTitle() {
92 return ts('Preferences Dates');
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Date Preference ID'),
108 'where' => 'civicrm_preferences_date.id',
109 'table_name' => 'civicrm_preferences_date',
110 'entity' => 'PreferencesDate',
111 'bao' => 'CRM_Core_BAO_PreferencesDate',
117 'type' => CRM_Utils_Type
::T_STRING
,
118 'title' => ts('Date Preference Name'),
119 'description' => ts('The meta name for this date (fixed in code)'),
122 'size' => CRM_Utils_Type
::BIG
,
123 'where' => 'civicrm_preferences_date.name',
124 'table_name' => 'civicrm_preferences_date',
125 'entity' => 'PreferencesDate',
126 'bao' => 'CRM_Core_BAO_PreferencesDate',
131 'name' => 'description',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Description'),
134 'description' => ts('Description of this date type.'),
136 'size' => CRM_Utils_Type
::HUGE
,
137 'where' => 'civicrm_preferences_date.description',
138 'table_name' => 'civicrm_preferences_date',
139 'entity' => 'PreferencesDate',
140 'bao' => 'CRM_Core_BAO_PreferencesDate',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Start'),
148 'description' => ts('The start offset relative to current year'),
150 'where' => 'civicrm_preferences_date.start',
151 'table_name' => 'civicrm_preferences_date',
152 'entity' => 'PreferencesDate',
153 'bao' => 'CRM_Core_BAO_PreferencesDate',
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('End Offset'),
161 'description' => ts('The end offset relative to current year, can be negative'),
163 'where' => 'civicrm_preferences_date.end',
164 'table_name' => 'civicrm_preferences_date',
165 'entity' => 'PreferencesDate',
166 'bao' => 'CRM_Core_BAO_PreferencesDate',
171 'name' => 'date_format',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Date Format'),
174 'description' => ts('The date type'),
176 'size' => CRM_Utils_Type
::BIG
,
177 'where' => 'civicrm_preferences_date.date_format',
178 'table_name' => 'civicrm_preferences_date',
179 'entity' => 'PreferencesDate',
180 'bao' => 'CRM_Core_BAO_PreferencesDate',
185 'name' => 'time_format',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Time Format'),
188 'description' => ts('time format'),
190 'size' => CRM_Utils_Type
::BIG
,
191 'where' => 'civicrm_preferences_date.time_format',
192 'table_name' => 'civicrm_preferences_date',
193 'entity' => 'PreferencesDate',
194 'bao' => 'CRM_Core_BAO_PreferencesDate',
199 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
201 return Civi
::$statics[__CLASS__
]['fields'];
205 * Return a mapping from field-name to the corresponding key (as used in fields()).
208 * Array(string $name => string $uniqueName).
210 public static function &fieldKeys() {
211 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
212 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
214 return Civi
::$statics[__CLASS__
]['fieldKeys'];
218 * Returns the names of this table
222 public static function getTableName() {
223 return self
::$_tableName;
227 * Returns if this table needs to be logged
231 public function getLog() {
236 * Returns the list of fields that can be imported
238 * @param bool $prefix
242 public static function &import($prefix = FALSE) {
243 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
248 * Returns the list of fields that can be exported
250 * @param bool $prefix
254 public static function &export($prefix = FALSE) {
255 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
260 * Returns the list of indices
262 * @param bool $localize
266 public static function indices($localize = TRUE) {
269 'name' => 'index_name',
273 'localizable' => FALSE,
274 'sig' => 'civicrm_preferences_date::0::name',
277 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;