5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/PreferencesDate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:50b4071bc8734a772c01b450d22f5920)
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 static $_tableName = 'civicrm_preferences_date';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 all the column names of this table
91 public static function &fields() {
92 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
93 Civi
::$statics[__CLASS__
]['fields'] = [
96 'type' => CRM_Utils_Type
::T_INT
,
97 'title' => ts('Date Preference ID'),
99 'table_name' => 'civicrm_preferences_date',
100 'entity' => 'PreferencesDate',
101 'bao' => 'CRM_Core_BAO_PreferencesDate',
106 'type' => CRM_Utils_Type
::T_STRING
,
107 'title' => ts('Date Preference Name'),
108 'description' => ts('The meta name for this date (fixed in code)'),
111 'size' => CRM_Utils_Type
::BIG
,
112 'table_name' => 'civicrm_preferences_date',
113 'entity' => 'PreferencesDate',
114 'bao' => 'CRM_Core_BAO_PreferencesDate',
118 'name' => 'description',
119 'type' => CRM_Utils_Type
::T_STRING
,
120 'title' => ts('Description'),
121 'description' => ts('Description of this date type.'),
123 'size' => CRM_Utils_Type
::HUGE
,
124 'table_name' => 'civicrm_preferences_date',
125 'entity' => 'PreferencesDate',
126 'bao' => 'CRM_Core_BAO_PreferencesDate',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Start'),
133 'description' => ts('The start offset relative to current year'),
135 'table_name' => 'civicrm_preferences_date',
136 'entity' => 'PreferencesDate',
137 'bao' => 'CRM_Core_BAO_PreferencesDate',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('End Offset'),
144 'description' => ts('The end offset relative to current year, can be negative'),
146 'table_name' => 'civicrm_preferences_date',
147 'entity' => 'PreferencesDate',
148 'bao' => 'CRM_Core_BAO_PreferencesDate',
152 'name' => 'date_format',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Date Format'),
155 'description' => ts('The date type'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'table_name' => 'civicrm_preferences_date',
159 'entity' => 'PreferencesDate',
160 'bao' => 'CRM_Core_BAO_PreferencesDate',
164 'name' => 'time_format',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Time Format'),
167 'description' => ts('time format'),
169 'size' => CRM_Utils_Type
::BIG
,
170 'table_name' => 'civicrm_preferences_date',
171 'entity' => 'PreferencesDate',
172 'bao' => 'CRM_Core_BAO_PreferencesDate',
176 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
178 return Civi
::$statics[__CLASS__
]['fields'];
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
185 * Array(string $name => string $uniqueName).
187 public static function &fieldKeys() {
188 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
189 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
191 return Civi
::$statics[__CLASS__
]['fieldKeys'];
195 * Returns the names of this table
199 public static function getTableName() {
200 return self
::$_tableName;
204 * Returns if this table needs to be logged
208 public function getLog() {
213 * Returns the list of fields that can be imported
215 * @param bool $prefix
219 public static function &import($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'preferences_date', $prefix, []);
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 public static function &export($prefix = FALSE) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'preferences_date', $prefix, []);
237 * Returns the list of indices
239 * @param bool $localize
243 public static function indices($localize = TRUE) {
246 'name' => 'index_name',
250 'localizable' => FALSE,
251 'sig' => 'civicrm_preferences_date::0::name',
254 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;