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:767dc30f83e4087a07c185f857fc8fb3)
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.
92 * Whether to return the plural version of the title.
94 public static function getEntityTitle($plural = FALSE) {
95 return $plural ?
ts('Preferences Dates') : ts('Preferences Date');
99 * Returns all the column names of this table
103 public static function &fields() {
104 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
105 Civi
::$statics[__CLASS__
]['fields'] = [
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Date Preference ID'),
111 'where' => 'civicrm_preferences_date.id',
112 'table_name' => 'civicrm_preferences_date',
113 'entity' => 'PreferencesDate',
114 'bao' => 'CRM_Core_BAO_PreferencesDate',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Date Preference Name'),
126 'description' => ts('The meta name for this date (fixed in code)'),
129 'size' => CRM_Utils_Type
::BIG
,
130 'where' => 'civicrm_preferences_date.name',
131 'table_name' => 'civicrm_preferences_date',
132 'entity' => 'PreferencesDate',
133 'bao' => 'CRM_Core_BAO_PreferencesDate',
138 'name' => 'description',
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('Description'),
141 'description' => ts('Description of this date type.'),
143 'size' => CRM_Utils_Type
::HUGE
,
144 'where' => 'civicrm_preferences_date.description',
145 'table_name' => 'civicrm_preferences_date',
146 'entity' => 'PreferencesDate',
147 'bao' => 'CRM_Core_BAO_PreferencesDate',
150 'label' => ts("Description"),
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Start'),
158 'description' => ts('The start offset relative to current year'),
160 'where' => 'civicrm_preferences_date.start',
161 'table_name' => 'civicrm_preferences_date',
162 'entity' => 'PreferencesDate',
163 'bao' => 'CRM_Core_BAO_PreferencesDate',
166 'label' => ts("Start"),
172 'type' => CRM_Utils_Type
::T_INT
,
173 'title' => ts('End Offset'),
174 'description' => ts('The end offset relative to current year, can be negative'),
176 'where' => 'civicrm_preferences_date.end',
177 'table_name' => 'civicrm_preferences_date',
178 'entity' => 'PreferencesDate',
179 'bao' => 'CRM_Core_BAO_PreferencesDate',
184 'name' => 'date_format',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('Date Format'),
187 'description' => ts('The date type'),
189 'size' => CRM_Utils_Type
::BIG
,
190 'where' => 'civicrm_preferences_date.date_format',
191 'table_name' => 'civicrm_preferences_date',
192 'entity' => 'PreferencesDate',
193 'bao' => 'CRM_Core_BAO_PreferencesDate',
196 'label' => ts("Date Format"),
201 'name' => 'time_format',
202 'type' => CRM_Utils_Type
::T_STRING
,
203 'title' => ts('Time Format'),
204 'description' => ts('time format'),
206 'size' => CRM_Utils_Type
::BIG
,
207 'where' => 'civicrm_preferences_date.time_format',
208 'table_name' => 'civicrm_preferences_date',
209 'entity' => 'PreferencesDate',
210 'bao' => 'CRM_Core_BAO_PreferencesDate',
213 'label' => ts("Time Format"),
218 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
220 return Civi
::$statics[__CLASS__
]['fields'];
224 * Return a mapping from field-name to the corresponding key (as used in fields()).
227 * Array(string $name => string $uniqueName).
229 public static function &fieldKeys() {
230 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
231 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
233 return Civi
::$statics[__CLASS__
]['fieldKeys'];
237 * Returns the names of this table
241 public static function getTableName() {
242 return self
::$_tableName;
246 * Returns if this table needs to be logged
250 public function getLog() {
255 * Returns the list of fields that can be imported
257 * @param bool $prefix
261 public static function &import($prefix = FALSE) {
262 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
267 * Returns the list of fields that can be exported
269 * @param bool $prefix
273 public static function &export($prefix = FALSE) {
274 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
279 * Returns the list of indices
281 * @param bool $localize
285 public static function indices($localize = TRUE) {
288 'name' => 'index_name',
292 'localizable' => FALSE,
293 'sig' => 'civicrm_preferences_date::0::name',
296 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;