Merge pull request #23202 from eileenmcnaughton/pay_links
[civicrm-core.git] / CRM / Core / DAO / PreferencesDate.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/PreferencesDate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2d2dbd5815ee810c6ca0941dcdea2b2f)
10 */
11
12 /**
13 * Database access object for the PreferencesDate entity.
14 */
15 class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '2.0';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_preferences_date';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = TRUE;
32
33 /**
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
37 */
38 public $id;
39
40 /**
41 * The meta name for this date (fixed in code)
42 *
43 * @var string
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
46 */
47 public $name;
48
49 /**
50 * Description of this date type.
51 *
52 * @var string|null
53 * (SQL type: varchar(255))
54 * Note that values will be retrieved from the database as a string.
55 */
56 public $description;
57
58 /**
59 * The start offset relative to current year
60 *
61 * @var int|string
62 * (SQL type: int)
63 * Note that values will be retrieved from the database as a string.
64 */
65 public $start;
66
67 /**
68 * The end offset relative to current year, can be negative
69 *
70 * @var int|string
71 * (SQL type: int)
72 * Note that values will be retrieved from the database as a string.
73 */
74 public $end;
75
76 /**
77 * The date type
78 *
79 * @var string|null
80 * (SQL type: varchar(64))
81 * Note that values will be retrieved from the database as a string.
82 */
83 public $date_format;
84
85 /**
86 * time format
87 *
88 * @var string|null
89 * (SQL type: varchar(64))
90 * Note that values will be retrieved from the database as a string.
91 */
92 public $time_format;
93
94 /**
95 * Class constructor.
96 */
97 public function __construct() {
98 $this->__table = 'civicrm_preferences_date';
99 parent::__construct();
100 }
101
102 /**
103 * Returns localized title of this entity.
104 *
105 * @param bool $plural
106 * Whether to return the plural version of the title.
107 */
108 public static function getEntityTitle($plural = FALSE) {
109 return $plural ? ts('Preferences Dates') : ts('Preferences Date');
110 }
111
112 /**
113 * Returns all the column names of this table
114 *
115 * @return array
116 */
117 public static function &fields() {
118 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
119 Civi::$statics[__CLASS__]['fields'] = [
120 'id' => [
121 'name' => 'id',
122 'type' => CRM_Utils_Type::T_INT,
123 'title' => ts('Date Preference ID'),
124 'required' => TRUE,
125 'where' => 'civicrm_preferences_date.id',
126 'table_name' => 'civicrm_preferences_date',
127 'entity' => 'PreferencesDate',
128 'bao' => 'CRM_Core_BAO_PreferencesDate',
129 'localizable' => 0,
130 'html' => [
131 'type' => 'Number',
132 ],
133 'readonly' => TRUE,
134 'add' => '2.0',
135 ],
136 'name' => [
137 'name' => 'name',
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)'),
141 'required' => TRUE,
142 'maxlength' => 64,
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',
148 'localizable' => 0,
149 'add' => '2.0',
150 ],
151 'description' => [
152 'name' => 'description',
153 'type' => CRM_Utils_Type::T_STRING,
154 'title' => ts('Description'),
155 'description' => ts('Description of this date type.'),
156 'maxlength' => 255,
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',
162 'localizable' => 0,
163 'html' => [
164 'label' => ts("Description"),
165 ],
166 'add' => '2.0',
167 ],
168 'start' => [
169 'name' => 'start',
170 'type' => CRM_Utils_Type::T_INT,
171 'title' => ts('Start'),
172 'description' => ts('The start offset relative to current year'),
173 'required' => TRUE,
174 'where' => 'civicrm_preferences_date.start',
175 'table_name' => 'civicrm_preferences_date',
176 'entity' => 'PreferencesDate',
177 'bao' => 'CRM_Core_BAO_PreferencesDate',
178 'localizable' => 0,
179 'html' => [
180 'label' => ts("Start"),
181 ],
182 'add' => '2.0',
183 ],
184 'end' => [
185 'name' => 'end',
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'),
189 'required' => TRUE,
190 'where' => 'civicrm_preferences_date.end',
191 'table_name' => 'civicrm_preferences_date',
192 'entity' => 'PreferencesDate',
193 'bao' => 'CRM_Core_BAO_PreferencesDate',
194 'localizable' => 0,
195 'add' => '2.0',
196 ],
197 'date_format' => [
198 'name' => 'date_format',
199 'type' => CRM_Utils_Type::T_STRING,
200 'title' => ts('Date Format'),
201 'description' => ts('The date type'),
202 'maxlength' => 64,
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',
208 'localizable' => 0,
209 'html' => [
210 'label' => ts("Date Format"),
211 ],
212 'add' => '2.0',
213 ],
214 'time_format' => [
215 'name' => 'time_format',
216 'type' => CRM_Utils_Type::T_STRING,
217 'title' => ts('Time Format'),
218 'description' => ts('time format'),
219 'maxlength' => 64,
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',
225 'localizable' => 0,
226 'html' => [
227 'label' => ts("Time Format"),
228 ],
229 'add' => '3.1',
230 ],
231 ];
232 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
233 }
234 return Civi::$statics[__CLASS__]['fields'];
235 }
236
237 /**
238 * Return a mapping from field-name to the corresponding key (as used in fields()).
239 *
240 * @return array
241 * Array(string $name => string $uniqueName).
242 */
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()));
246 }
247 return Civi::$statics[__CLASS__]['fieldKeys'];
248 }
249
250 /**
251 * Returns the names of this table
252 *
253 * @return string
254 */
255 public static function getTableName() {
256 return self::$_tableName;
257 }
258
259 /**
260 * Returns if this table needs to be logged
261 *
262 * @return bool
263 */
264 public function getLog() {
265 return self::$_log;
266 }
267
268 /**
269 * Returns the list of fields that can be imported
270 *
271 * @param bool $prefix
272 *
273 * @return array
274 */
275 public static function &import($prefix = FALSE) {
276 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'preferences_date', $prefix, []);
277 return $r;
278 }
279
280 /**
281 * Returns the list of fields that can be exported
282 *
283 * @param bool $prefix
284 *
285 * @return array
286 */
287 public static function &export($prefix = FALSE) {
288 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'preferences_date', $prefix, []);
289 return $r;
290 }
291
292 /**
293 * Returns the list of indices
294 *
295 * @param bool $localize
296 *
297 * @return array
298 */
299 public static function indices($localize = TRUE) {
300 $indices = [
301 'index_name' => [
302 'name' => 'index_name',
303 'field' => [
304 0 => 'name',
305 ],
306 'localizable' => FALSE,
307 'sig' => 'civicrm_preferences_date::0::name',
308 ],
309 ];
310 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
311 }
312
313 }