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:2d2dbd5815ee810c6ca0941dcdea2b2f)
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;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * The meta name for this date (fixed in code)
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
50 * Description of this date type.
53 * (SQL type: varchar(255))
54 * Note that values will be retrieved from the database as a string.
59 * The start offset relative to current year
63 * Note that values will be retrieved from the database as a string.
68 * The end offset relative to current year, can be negative
72 * Note that values will be retrieved from the database as a string.
80 * (SQL type: varchar(64))
81 * Note that values will be retrieved from the database as a string.
89 * (SQL type: varchar(64))
90 * Note that values will be retrieved from the database as a string.
97 public function __construct() {
98 $this->__table
= 'civicrm_preferences_date';
99 parent
::__construct();
103 * Returns localized title of this entity.
105 * @param bool $plural
106 * Whether to return the plural version of the title.
108 public static function getEntityTitle($plural = FALSE) {
109 return $plural ?
ts('Preferences Dates') : ts('Preferences Date');
113 * Returns all the column names of this table
117 public static function &fields() {
118 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
119 Civi
::$statics[__CLASS__
]['fields'] = [
122 'type' => CRM_Utils_Type
::T_INT
,
123 'title' => ts('Date Preference ID'),
125 'where' => 'civicrm_preferences_date.id',
126 'table_name' => 'civicrm_preferences_date',
127 'entity' => 'PreferencesDate',
128 'bao' => 'CRM_Core_BAO_PreferencesDate',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Date Preference Name'),
140 'description' => ts('The meta name for this date (fixed in code)'),
143 'size' => CRM_Utils_Type
::BIG
,
144 'where' => 'civicrm_preferences_date.name',
145 'table_name' => 'civicrm_preferences_date',
146 'entity' => 'PreferencesDate',
147 'bao' => 'CRM_Core_BAO_PreferencesDate',
152 'name' => 'description',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Description'),
155 'description' => ts('Description of this date type.'),
157 'size' => CRM_Utils_Type
::HUGE
,
158 'where' => 'civicrm_preferences_date.description',
159 'table_name' => 'civicrm_preferences_date',
160 'entity' => 'PreferencesDate',
161 'bao' => 'CRM_Core_BAO_PreferencesDate',
164 'label' => ts("Description"),
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Start'),
172 'description' => ts('The start offset relative to current year'),
174 'where' => 'civicrm_preferences_date.start',
175 'table_name' => 'civicrm_preferences_date',
176 'entity' => 'PreferencesDate',
177 'bao' => 'CRM_Core_BAO_PreferencesDate',
180 'label' => ts("Start"),
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('End Offset'),
188 'description' => ts('The end offset relative to current year, can be negative'),
190 'where' => 'civicrm_preferences_date.end',
191 'table_name' => 'civicrm_preferences_date',
192 'entity' => 'PreferencesDate',
193 'bao' => 'CRM_Core_BAO_PreferencesDate',
198 'name' => 'date_format',
199 'type' => CRM_Utils_Type
::T_STRING
,
200 'title' => ts('Date Format'),
201 'description' => ts('The date type'),
203 'size' => CRM_Utils_Type
::BIG
,
204 'where' => 'civicrm_preferences_date.date_format',
205 'table_name' => 'civicrm_preferences_date',
206 'entity' => 'PreferencesDate',
207 'bao' => 'CRM_Core_BAO_PreferencesDate',
210 'label' => ts("Date Format"),
215 'name' => 'time_format',
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Time Format'),
218 'description' => ts('time format'),
220 'size' => CRM_Utils_Type
::BIG
,
221 'where' => 'civicrm_preferences_date.time_format',
222 'table_name' => 'civicrm_preferences_date',
223 'entity' => 'PreferencesDate',
224 'bao' => 'CRM_Core_BAO_PreferencesDate',
227 'label' => ts("Time Format"),
232 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
234 return Civi
::$statics[__CLASS__
]['fields'];
238 * Return a mapping from field-name to the corresponding key (as used in fields()).
241 * Array(string $name => string $uniqueName).
243 public static function &fieldKeys() {
244 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
245 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
247 return Civi
::$statics[__CLASS__
]['fieldKeys'];
251 * Returns the names of this table
255 public static function getTableName() {
256 return self
::$_tableName;
260 * Returns if this table needs to be logged
264 public function getLog() {
269 * Returns the list of fields that can be imported
271 * @param bool $prefix
275 public static function &import($prefix = FALSE) {
276 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
281 * Returns the list of fields that can be exported
283 * @param bool $prefix
287 public static function &export($prefix = FALSE) {
288 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
293 * Returns the list of indices
295 * @param bool $localize
299 public static function indices($localize = TRUE) {
302 'name' => 'index_name',
306 'localizable' => FALSE,
307 'sig' => 'civicrm_preferences_date::0::name',
310 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;