Regenerate DAO files
[civicrm-core.git] / CRM / Core / DAO / PreferencesDate.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/PreferencesDate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:18663ed2b585f1598a26a5a491c67ea6)
10 */
11
12 /**
13 * Database access object for the PreferencesDate entity.
14 */
15 class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_preferences_date';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = TRUE;
30
31 /**
32 * @var int
33 */
34 public $id;
35
36 /**
37 * The meta name for this date (fixed in code)
38 *
39 * @var string
40 */
41 public $name;
42
43 /**
44 * Description of this date type.
45 *
46 * @var string
47 */
48 public $description;
49
50 /**
51 * The start offset relative to current year
52 *
53 * @var int
54 */
55 public $start;
56
57 /**
58 * The end offset relative to current year, can be negative
59 *
60 * @var int
61 */
62 public $end;
63
64 /**
65 * The date type
66 *
67 * @var string
68 */
69 public $date_format;
70
71 /**
72 * time format
73 *
74 * @var string
75 */
76 public $time_format;
77
78 /**
79 * Class constructor.
80 */
81 public function __construct() {
82 $this->__table = 'civicrm_preferences_date';
83 parent::__construct();
84 }
85
86 /**
87 * Returns all the column names of this table
88 *
89 * @return array
90 */
91 public static function &fields() {
92 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
93 Civi::$statics[__CLASS__]['fields'] = [
94 'id' => [
95 'name' => 'id',
96 'type' => CRM_Utils_Type::T_INT,
97 'title' => ts('Date Preference ID'),
98 'required' => TRUE,
99 'where' => 'civicrm_preferences_date.id',
100 'table_name' => 'civicrm_preferences_date',
101 'entity' => 'PreferencesDate',
102 'bao' => 'CRM_Core_BAO_PreferencesDate',
103 'localizable' => 0,
104 ],
105 'name' => [
106 'name' => 'name',
107 'type' => CRM_Utils_Type::T_STRING,
108 'title' => ts('Date Preference Name'),
109 'description' => ts('The meta name for this date (fixed in code)'),
110 'required' => TRUE,
111 'maxlength' => 64,
112 'size' => CRM_Utils_Type::BIG,
113 'where' => 'civicrm_preferences_date.name',
114 'table_name' => 'civicrm_preferences_date',
115 'entity' => 'PreferencesDate',
116 'bao' => 'CRM_Core_BAO_PreferencesDate',
117 'localizable' => 0,
118 ],
119 'description' => [
120 'name' => 'description',
121 'type' => CRM_Utils_Type::T_STRING,
122 'title' => ts('Description'),
123 'description' => ts('Description of this date type.'),
124 'maxlength' => 255,
125 'size' => CRM_Utils_Type::HUGE,
126 'where' => 'civicrm_preferences_date.description',
127 'table_name' => 'civicrm_preferences_date',
128 'entity' => 'PreferencesDate',
129 'bao' => 'CRM_Core_BAO_PreferencesDate',
130 'localizable' => 0,
131 ],
132 'start' => [
133 'name' => 'start',
134 'type' => CRM_Utils_Type::T_INT,
135 'title' => ts('Start'),
136 'description' => ts('The start offset relative to current year'),
137 'required' => TRUE,
138 'where' => 'civicrm_preferences_date.start',
139 'table_name' => 'civicrm_preferences_date',
140 'entity' => 'PreferencesDate',
141 'bao' => 'CRM_Core_BAO_PreferencesDate',
142 'localizable' => 0,
143 ],
144 'end' => [
145 'name' => 'end',
146 'type' => CRM_Utils_Type::T_INT,
147 'title' => ts('End Offset'),
148 'description' => ts('The end offset relative to current year, can be negative'),
149 'required' => TRUE,
150 'where' => 'civicrm_preferences_date.end',
151 'table_name' => 'civicrm_preferences_date',
152 'entity' => 'PreferencesDate',
153 'bao' => 'CRM_Core_BAO_PreferencesDate',
154 'localizable' => 0,
155 ],
156 'date_format' => [
157 'name' => 'date_format',
158 'type' => CRM_Utils_Type::T_STRING,
159 'title' => ts('Date Format'),
160 'description' => ts('The date type'),
161 'maxlength' => 64,
162 'size' => CRM_Utils_Type::BIG,
163 'where' => 'civicrm_preferences_date.date_format',
164 'table_name' => 'civicrm_preferences_date',
165 'entity' => 'PreferencesDate',
166 'bao' => 'CRM_Core_BAO_PreferencesDate',
167 'localizable' => 0,
168 ],
169 'time_format' => [
170 'name' => 'time_format',
171 'type' => CRM_Utils_Type::T_STRING,
172 'title' => ts('Time Format'),
173 'description' => ts('time format'),
174 'maxlength' => 64,
175 'size' => CRM_Utils_Type::BIG,
176 'where' => 'civicrm_preferences_date.time_format',
177 'table_name' => 'civicrm_preferences_date',
178 'entity' => 'PreferencesDate',
179 'bao' => 'CRM_Core_BAO_PreferencesDate',
180 'localizable' => 0,
181 ],
182 ];
183 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
184 }
185 return Civi::$statics[__CLASS__]['fields'];
186 }
187
188 /**
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
190 *
191 * @return array
192 * Array(string $name => string $uniqueName).
193 */
194 public static function &fieldKeys() {
195 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
196 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
197 }
198 return Civi::$statics[__CLASS__]['fieldKeys'];
199 }
200
201 /**
202 * Returns the names of this table
203 *
204 * @return string
205 */
206 public static function getTableName() {
207 return self::$_tableName;
208 }
209
210 /**
211 * Returns if this table needs to be logged
212 *
213 * @return bool
214 */
215 public function getLog() {
216 return self::$_log;
217 }
218
219 /**
220 * Returns the list of fields that can be imported
221 *
222 * @param bool $prefix
223 *
224 * @return array
225 */
226 public static function &import($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'preferences_date', $prefix, []);
228 return $r;
229 }
230
231 /**
232 * Returns the list of fields that can be exported
233 *
234 * @param bool $prefix
235 *
236 * @return array
237 */
238 public static function &export($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'preferences_date', $prefix, []);
240 return $r;
241 }
242
243 /**
244 * Returns the list of indices
245 *
246 * @param bool $localize
247 *
248 * @return array
249 */
250 public static function indices($localize = TRUE) {
251 $indices = [
252 'index_name' => [
253 'name' => 'index_name',
254 'field' => [
255 0 => 'name',
256 ],
257 'localizable' => FALSE,
258 'sig' => 'civicrm_preferences_date::0::name',
259 ],
260 ];
261 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
262 }
263
264 }