Set version to 5.28.alpha1
[civicrm-core.git] / CRM / Member / DAO / MembershipStatus.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:37fdd036d0cc453eeb5cbfa14b7b27d2)
10 */
11
12 /**
13 * Database access object for the MembershipStatus entity.
14 */
15 class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_membership_status';
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 * Membership Id
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Name for Membership Status
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Label for Membership Status
47 *
48 * @var string
49 */
50 public $label;
51
52 /**
53 * Event when this status starts.
54 *
55 * @var string
56 */
57 public $start_event;
58
59 /**
60 * Unit used for adjusting from start_event.
61 *
62 * @var string
63 */
64 public $start_event_adjust_unit;
65
66 /**
67 * Status range begins this many units from start_event.
68 *
69 * @var int
70 */
71 public $start_event_adjust_interval;
72
73 /**
74 * Event after which this status ends.
75 *
76 * @var string
77 */
78 public $end_event;
79
80 /**
81 * Unit used for adjusting from the ending event.
82 *
83 * @var string
84 */
85 public $end_event_adjust_unit;
86
87 /**
88 * Status range ends this many units from end_event.
89 *
90 * @var int
91 */
92 public $end_event_adjust_interval;
93
94 /**
95 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
96 *
97 * @var bool
98 */
99 public $is_current_member;
100
101 /**
102 * Is this status for admin/manual assignment only.
103 *
104 * @var bool
105 */
106 public $is_admin;
107
108 /**
109 * @var int
110 */
111 public $weight;
112
113 /**
114 * Assign this status to a membership record if no other status match is found.
115 *
116 * @var bool
117 */
118 public $is_default;
119
120 /**
121 * Is this membership_status enabled.
122 *
123 * @var bool
124 */
125 public $is_active;
126
127 /**
128 * Is this membership_status reserved.
129 *
130 * @var bool
131 */
132 public $is_reserved;
133
134 /**
135 * Class constructor.
136 */
137 public function __construct() {
138 $this->__table = 'civicrm_membership_status';
139 parent::__construct();
140 }
141
142 /**
143 * Returns all the column names of this table
144 *
145 * @return array
146 */
147 public static function &fields() {
148 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
149 Civi::$statics[__CLASS__]['fields'] = [
150 'id' => [
151 'name' => 'id',
152 'type' => CRM_Utils_Type::T_INT,
153 'title' => ts('Membership Status ID'),
154 'description' => ts('Membership Id'),
155 'required' => TRUE,
156 'where' => 'civicrm_membership_status.id',
157 'table_name' => 'civicrm_membership_status',
158 'entity' => 'MembershipStatus',
159 'bao' => 'CRM_Member_BAO_MembershipStatus',
160 'localizable' => 0,
161 ],
162 'membership_status' => [
163 'name' => 'name',
164 'type' => CRM_Utils_Type::T_STRING,
165 'title' => ts('Membership Status'),
166 'description' => ts('Name for Membership Status'),
167 'maxlength' => 128,
168 'size' => CRM_Utils_Type::HUGE,
169 'import' => TRUE,
170 'where' => 'civicrm_membership_status.name',
171 'export' => TRUE,
172 'table_name' => 'civicrm_membership_status',
173 'entity' => 'MembershipStatus',
174 'bao' => 'CRM_Member_BAO_MembershipStatus',
175 'localizable' => 0,
176 ],
177 'label' => [
178 'name' => 'label',
179 'type' => CRM_Utils_Type::T_STRING,
180 'title' => ts('Label'),
181 'description' => ts('Label for Membership Status'),
182 'maxlength' => 128,
183 'size' => CRM_Utils_Type::HUGE,
184 'where' => 'civicrm_membership_status.label',
185 'table_name' => 'civicrm_membership_status',
186 'entity' => 'MembershipStatus',
187 'bao' => 'CRM_Member_BAO_MembershipStatus',
188 'localizable' => 1,
189 'html' => [
190 'type' => 'Text',
191 ],
192 ],
193 'start_event' => [
194 'name' => 'start_event',
195 'type' => CRM_Utils_Type::T_STRING,
196 'title' => ts('Start Event'),
197 'description' => ts('Event when this status starts.'),
198 'maxlength' => 12,
199 'size' => CRM_Utils_Type::TWELVE,
200 'where' => 'civicrm_membership_status.start_event',
201 'table_name' => 'civicrm_membership_status',
202 'entity' => 'MembershipStatus',
203 'bao' => 'CRM_Member_BAO_MembershipStatus',
204 'localizable' => 0,
205 'html' => [
206 'type' => 'Select',
207 ],
208 'pseudoconstant' => [
209 'callback' => 'CRM_Core_SelectValues::eventDate',
210 ],
211 ],
212 'start_event_adjust_unit' => [
213 'name' => 'start_event_adjust_unit',
214 'type' => CRM_Utils_Type::T_STRING,
215 'title' => ts('Start Event Adjust Unit'),
216 'description' => ts('Unit used for adjusting from start_event.'),
217 'maxlength' => 8,
218 'size' => CRM_Utils_Type::EIGHT,
219 'where' => 'civicrm_membership_status.start_event_adjust_unit',
220 'table_name' => 'civicrm_membership_status',
221 'entity' => 'MembershipStatus',
222 'bao' => 'CRM_Member_BAO_MembershipStatus',
223 'localizable' => 0,
224 'html' => [
225 'type' => 'Select',
226 ],
227 'pseudoconstant' => [
228 'callback' => 'CRM_Core_SelectValues::unitList',
229 ],
230 ],
231 'start_event_adjust_interval' => [
232 'name' => 'start_event_adjust_interval',
233 'type' => CRM_Utils_Type::T_INT,
234 'title' => ts('Start Event Adjust Interval'),
235 'description' => ts('Status range begins this many units from start_event.'),
236 'where' => 'civicrm_membership_status.start_event_adjust_interval',
237 'table_name' => 'civicrm_membership_status',
238 'entity' => 'MembershipStatus',
239 'bao' => 'CRM_Member_BAO_MembershipStatus',
240 'localizable' => 0,
241 ],
242 'end_event' => [
243 'name' => 'end_event',
244 'type' => CRM_Utils_Type::T_STRING,
245 'title' => ts('End Event'),
246 'description' => ts('Event after which this status ends.'),
247 'maxlength' => 12,
248 'size' => CRM_Utils_Type::TWELVE,
249 'where' => 'civicrm_membership_status.end_event',
250 'table_name' => 'civicrm_membership_status',
251 'entity' => 'MembershipStatus',
252 'bao' => 'CRM_Member_BAO_MembershipStatus',
253 'localizable' => 0,
254 'html' => [
255 'type' => 'Select',
256 ],
257 'pseudoconstant' => [
258 'callback' => 'CRM_Core_SelectValues::eventDate',
259 ],
260 ],
261 'end_event_adjust_unit' => [
262 'name' => 'end_event_adjust_unit',
263 'type' => CRM_Utils_Type::T_STRING,
264 'title' => ts('End Event Adjust Unit'),
265 'description' => ts('Unit used for adjusting from the ending event.'),
266 'maxlength' => 8,
267 'size' => CRM_Utils_Type::EIGHT,
268 'where' => 'civicrm_membership_status.end_event_adjust_unit',
269 'table_name' => 'civicrm_membership_status',
270 'entity' => 'MembershipStatus',
271 'bao' => 'CRM_Member_BAO_MembershipStatus',
272 'localizable' => 0,
273 'html' => [
274 'type' => 'Select',
275 ],
276 'pseudoconstant' => [
277 'callback' => 'CRM_Core_SelectValues::unitList',
278 ],
279 ],
280 'end_event_adjust_interval' => [
281 'name' => 'end_event_adjust_interval',
282 'type' => CRM_Utils_Type::T_INT,
283 'title' => ts('End Event Adjust Interval'),
284 'description' => ts('Status range ends this many units from end_event.'),
285 'where' => 'civicrm_membership_status.end_event_adjust_interval',
286 'table_name' => 'civicrm_membership_status',
287 'entity' => 'MembershipStatus',
288 'bao' => 'CRM_Member_BAO_MembershipStatus',
289 'localizable' => 0,
290 ],
291 'is_current_member' => [
292 'name' => 'is_current_member',
293 'type' => CRM_Utils_Type::T_BOOLEAN,
294 'title' => ts('Current Membership?'),
295 'description' => ts('Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).'),
296 'where' => 'civicrm_membership_status.is_current_member',
297 'table_name' => 'civicrm_membership_status',
298 'entity' => 'MembershipStatus',
299 'bao' => 'CRM_Member_BAO_MembershipStatus',
300 'localizable' => 0,
301 ],
302 'is_admin' => [
303 'name' => 'is_admin',
304 'type' => CRM_Utils_Type::T_BOOLEAN,
305 'title' => ts('Administrator Only?'),
306 'description' => ts('Is this status for admin/manual assignment only.'),
307 'where' => 'civicrm_membership_status.is_admin',
308 'table_name' => 'civicrm_membership_status',
309 'entity' => 'MembershipStatus',
310 'bao' => 'CRM_Member_BAO_MembershipStatus',
311 'localizable' => 0,
312 'html' => [
313 'type' => 'CheckBox',
314 ],
315 ],
316 'weight' => [
317 'name' => 'weight',
318 'type' => CRM_Utils_Type::T_INT,
319 'title' => ts('Order'),
320 'where' => 'civicrm_membership_status.weight',
321 'table_name' => 'civicrm_membership_status',
322 'entity' => 'MembershipStatus',
323 'bao' => 'CRM_Member_BAO_MembershipStatus',
324 'localizable' => 0,
325 ],
326 'is_default' => [
327 'name' => 'is_default',
328 'type' => CRM_Utils_Type::T_BOOLEAN,
329 'title' => ts('Default Status?'),
330 'description' => ts('Assign this status to a membership record if no other status match is found.'),
331 'where' => 'civicrm_membership_status.is_default',
332 'table_name' => 'civicrm_membership_status',
333 'entity' => 'MembershipStatus',
334 'bao' => 'CRM_Member_BAO_MembershipStatus',
335 'localizable' => 0,
336 'html' => [
337 'type' => 'CheckBox',
338 ],
339 ],
340 'is_active' => [
341 'name' => 'is_active',
342 'type' => CRM_Utils_Type::T_BOOLEAN,
343 'title' => ts('Is Active'),
344 'description' => ts('Is this membership_status enabled.'),
345 'where' => 'civicrm_membership_status.is_active',
346 'default' => '1',
347 'table_name' => 'civicrm_membership_status',
348 'entity' => 'MembershipStatus',
349 'bao' => 'CRM_Member_BAO_MembershipStatus',
350 'localizable' => 0,
351 'html' => [
352 'type' => 'CheckBox',
353 ],
354 ],
355 'is_reserved' => [
356 'name' => 'is_reserved',
357 'type' => CRM_Utils_Type::T_BOOLEAN,
358 'title' => ts('Is Reserved'),
359 'description' => ts('Is this membership_status reserved.'),
360 'where' => 'civicrm_membership_status.is_reserved',
361 'default' => '0',
362 'table_name' => 'civicrm_membership_status',
363 'entity' => 'MembershipStatus',
364 'bao' => 'CRM_Member_BAO_MembershipStatus',
365 'localizable' => 0,
366 'html' => [
367 'type' => 'CheckBox',
368 ],
369 ],
370 ];
371 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
372 }
373 return Civi::$statics[__CLASS__]['fields'];
374 }
375
376 /**
377 * Return a mapping from field-name to the corresponding key (as used in fields()).
378 *
379 * @return array
380 * Array(string $name => string $uniqueName).
381 */
382 public static function &fieldKeys() {
383 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
384 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
385 }
386 return Civi::$statics[__CLASS__]['fieldKeys'];
387 }
388
389 /**
390 * Returns the names of this table
391 *
392 * @return string
393 */
394 public static function getTableName() {
395 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
396 }
397
398 /**
399 * Returns if this table needs to be logged
400 *
401 * @return bool
402 */
403 public function getLog() {
404 return self::$_log;
405 }
406
407 /**
408 * Returns the list of fields that can be imported
409 *
410 * @param bool $prefix
411 *
412 * @return array
413 */
414 public static function &import($prefix = FALSE) {
415 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_status', $prefix, []);
416 return $r;
417 }
418
419 /**
420 * Returns the list of fields that can be exported
421 *
422 * @param bool $prefix
423 *
424 * @return array
425 */
426 public static function &export($prefix = FALSE) {
427 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_status', $prefix, []);
428 return $r;
429 }
430
431 /**
432 * Returns the list of indices
433 *
434 * @param bool $localize
435 *
436 * @return array
437 */
438 public static function indices($localize = TRUE) {
439 $indices = [];
440 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
441 }
442
443 }