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:d0de29e655d17a479ec8cfc762582c39)
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',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Date Preference Name'),
122 'description' => ts('The meta name for this date (fixed in code)'),
125 'size' => CRM_Utils_Type
::BIG
,
126 'where' => 'civicrm_preferences_date.name',
127 'table_name' => 'civicrm_preferences_date',
128 'entity' => 'PreferencesDate',
129 'bao' => 'CRM_Core_BAO_PreferencesDate',
134 'name' => 'description',
135 'type' => CRM_Utils_Type
::T_STRING
,
136 'title' => ts('Description'),
137 'description' => ts('Description of this date type.'),
139 'size' => CRM_Utils_Type
::HUGE
,
140 'where' => 'civicrm_preferences_date.description',
141 'table_name' => 'civicrm_preferences_date',
142 'entity' => 'PreferencesDate',
143 'bao' => 'CRM_Core_BAO_PreferencesDate',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Start'),
151 'description' => ts('The start offset relative to current year'),
153 'where' => 'civicrm_preferences_date.start',
154 'table_name' => 'civicrm_preferences_date',
155 'entity' => 'PreferencesDate',
156 'bao' => 'CRM_Core_BAO_PreferencesDate',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('End Offset'),
164 'description' => ts('The end offset relative to current year, can be negative'),
166 'where' => 'civicrm_preferences_date.end',
167 'table_name' => 'civicrm_preferences_date',
168 'entity' => 'PreferencesDate',
169 'bao' => 'CRM_Core_BAO_PreferencesDate',
174 'name' => 'date_format',
175 'type' => CRM_Utils_Type
::T_STRING
,
176 'title' => ts('Date Format'),
177 'description' => ts('The date type'),
179 'size' => CRM_Utils_Type
::BIG
,
180 'where' => 'civicrm_preferences_date.date_format',
181 'table_name' => 'civicrm_preferences_date',
182 'entity' => 'PreferencesDate',
183 'bao' => 'CRM_Core_BAO_PreferencesDate',
188 'name' => 'time_format',
189 'type' => CRM_Utils_Type
::T_STRING
,
190 'title' => ts('Time Format'),
191 'description' => ts('time format'),
193 'size' => CRM_Utils_Type
::BIG
,
194 'where' => 'civicrm_preferences_date.time_format',
195 'table_name' => 'civicrm_preferences_date',
196 'entity' => 'PreferencesDate',
197 'bao' => 'CRM_Core_BAO_PreferencesDate',
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 * Array(string $name => string $uniqueName).
213 public static function &fieldKeys() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
215 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
217 return Civi
::$statics[__CLASS__
]['fieldKeys'];
221 * Returns the names of this table
225 public static function getTableName() {
226 return self
::$_tableName;
230 * Returns if this table needs to be logged
234 public function getLog() {
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
251 * Returns the list of fields that can be exported
253 * @param bool $prefix
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
263 * Returns the list of indices
265 * @param bool $localize
269 public static function indices($localize = TRUE) {
272 'name' => 'index_name',
276 'localizable' => FALSE,
277 'sig' => 'civicrm_preferences_date::0::name',
280 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;