Merge pull request #17511 from mattwire/paymentprocessoraddfrontendfunctions
[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:59621b636915c317561204de52299004)
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 localized title of this entity.
88 */
89 public static function getEntityTitle() {
90 return ts('Preferences Dates');
91 }
92
93 /**
94 * Returns all the column names of this table
95 *
96 * @return array
97 */
98 public static function &fields() {
99 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
100 Civi::$statics[__CLASS__]['fields'] = [
101 'id' => [
102 'name' => 'id',
103 'type' => CRM_Utils_Type::T_INT,
104 'title' => ts('Date Preference ID'),
105 'required' => TRUE,
106 'where' => 'civicrm_preferences_date.id',
107 'table_name' => 'civicrm_preferences_date',
108 'entity' => 'PreferencesDate',
109 'bao' => 'CRM_Core_BAO_PreferencesDate',
110 'localizable' => 0,
111 ],
112 'name' => [
113 'name' => 'name',
114 'type' => CRM_Utils_Type::T_STRING,
115 'title' => ts('Date Preference Name'),
116 'description' => ts('The meta name for this date (fixed in code)'),
117 'required' => TRUE,
118 'maxlength' => 64,
119 'size' => CRM_Utils_Type::BIG,
120 'where' => 'civicrm_preferences_date.name',
121 'table_name' => 'civicrm_preferences_date',
122 'entity' => 'PreferencesDate',
123 'bao' => 'CRM_Core_BAO_PreferencesDate',
124 'localizable' => 0,
125 ],
126 'description' => [
127 'name' => 'description',
128 'type' => CRM_Utils_Type::T_STRING,
129 'title' => ts('Description'),
130 'description' => ts('Description of this date type.'),
131 'maxlength' => 255,
132 'size' => CRM_Utils_Type::HUGE,
133 'where' => 'civicrm_preferences_date.description',
134 'table_name' => 'civicrm_preferences_date',
135 'entity' => 'PreferencesDate',
136 'bao' => 'CRM_Core_BAO_PreferencesDate',
137 'localizable' => 0,
138 ],
139 'start' => [
140 'name' => 'start',
141 'type' => CRM_Utils_Type::T_INT,
142 'title' => ts('Start'),
143 'description' => ts('The start offset relative to current year'),
144 'required' => TRUE,
145 'where' => 'civicrm_preferences_date.start',
146 'table_name' => 'civicrm_preferences_date',
147 'entity' => 'PreferencesDate',
148 'bao' => 'CRM_Core_BAO_PreferencesDate',
149 'localizable' => 0,
150 ],
151 'end' => [
152 'name' => 'end',
153 'type' => CRM_Utils_Type::T_INT,
154 'title' => ts('End Offset'),
155 'description' => ts('The end offset relative to current year, can be negative'),
156 'required' => TRUE,
157 'where' => 'civicrm_preferences_date.end',
158 'table_name' => 'civicrm_preferences_date',
159 'entity' => 'PreferencesDate',
160 'bao' => 'CRM_Core_BAO_PreferencesDate',
161 'localizable' => 0,
162 ],
163 'date_format' => [
164 'name' => 'date_format',
165 'type' => CRM_Utils_Type::T_STRING,
166 'title' => ts('Date Format'),
167 'description' => ts('The date type'),
168 'maxlength' => 64,
169 'size' => CRM_Utils_Type::BIG,
170 'where' => 'civicrm_preferences_date.date_format',
171 'table_name' => 'civicrm_preferences_date',
172 'entity' => 'PreferencesDate',
173 'bao' => 'CRM_Core_BAO_PreferencesDate',
174 'localizable' => 0,
175 ],
176 'time_format' => [
177 'name' => 'time_format',
178 'type' => CRM_Utils_Type::T_STRING,
179 'title' => ts('Time Format'),
180 'description' => ts('time format'),
181 'maxlength' => 64,
182 'size' => CRM_Utils_Type::BIG,
183 'where' => 'civicrm_preferences_date.time_format',
184 'table_name' => 'civicrm_preferences_date',
185 'entity' => 'PreferencesDate',
186 'bao' => 'CRM_Core_BAO_PreferencesDate',
187 'localizable' => 0,
188 ],
189 ];
190 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
191 }
192 return Civi::$statics[__CLASS__]['fields'];
193 }
194
195 /**
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
197 *
198 * @return array
199 * Array(string $name => string $uniqueName).
200 */
201 public static function &fieldKeys() {
202 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
203 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
204 }
205 return Civi::$statics[__CLASS__]['fieldKeys'];
206 }
207
208 /**
209 * Returns the names of this table
210 *
211 * @return string
212 */
213 public static function getTableName() {
214 return self::$_tableName;
215 }
216
217 /**
218 * Returns if this table needs to be logged
219 *
220 * @return bool
221 */
222 public function getLog() {
223 return self::$_log;
224 }
225
226 /**
227 * Returns the list of fields that can be imported
228 *
229 * @param bool $prefix
230 *
231 * @return array
232 */
233 public static function &import($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'preferences_date', $prefix, []);
235 return $r;
236 }
237
238 /**
239 * Returns the list of fields that can be exported
240 *
241 * @param bool $prefix
242 *
243 * @return array
244 */
245 public static function &export($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'preferences_date', $prefix, []);
247 return $r;
248 }
249
250 /**
251 * Returns the list of indices
252 *
253 * @param bool $localize
254 *
255 * @return array
256 */
257 public static function indices($localize = TRUE) {
258 $indices = [
259 'index_name' => [
260 'name' => 'index_name',
261 'field' => [
262 0 => 'name',
263 ],
264 'localizable' => FALSE,
265 'sig' => 'civicrm_preferences_date::0::name',
266 ],
267 ];
268 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
269 }
270
271 }