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