5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6bdad135e9f0e94f085296d68ca59253)
13 * Database access object for the MembershipStatus entity.
15 class CRM_Member_DAO_MembershipStatus
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.5';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_membership_status';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * Name for Membership Status
48 * Label for Membership Status
55 * Event when this status starts.
62 * Unit used for adjusting from start_event.
66 public $start_event_adjust_unit;
69 * Status range begins this many units from start_event.
73 public $start_event_adjust_interval;
76 * Event after which this status ends.
83 * Unit used for adjusting from the ending event.
87 public $end_event_adjust_unit;
90 * Status range ends this many units from end_event.
94 public $end_event_adjust_interval;
97 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
101 public $is_current_member;
104 * Is this status for admin/manual assignment only.
116 * Assign this status to a membership record if no other status match is found.
123 * Is this membership_status enabled.
130 * Is this membership_status reserved.
139 public function __construct() {
140 $this->__table
= 'civicrm_membership_status';
141 parent
::__construct();
145 * Returns localized title of this entity.
147 * @param bool $plural
148 * Whether to return the plural version of the title.
150 public static function getEntityTitle($plural = FALSE) {
151 return $plural ?
ts('Membership Statuses') : ts('Membership Status');
155 * Returns all the column names of this table
159 public static function &fields() {
160 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
161 Civi
::$statics[__CLASS__
]['fields'] = [
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Membership Status ID'),
166 'description' => ts('Membership Id'),
168 'where' => 'civicrm_membership_status.id',
169 'table_name' => 'civicrm_membership_status',
170 'entity' => 'MembershipStatus',
171 'bao' => 'CRM_Member_BAO_MembershipStatus',
175 'membership_status' => [
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Membership Status'),
179 'description' => ts('Name for Membership Status'),
181 'size' => CRM_Utils_Type
::HUGE
,
183 'where' => 'civicrm_membership_status.name',
185 'table_name' => 'civicrm_membership_status',
186 'entity' => 'MembershipStatus',
187 'bao' => 'CRM_Member_BAO_MembershipStatus',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Label'),
195 'description' => ts('Label for Membership Status'),
197 'size' => CRM_Utils_Type
::HUGE
,
198 'where' => 'civicrm_membership_status.label',
199 'table_name' => 'civicrm_membership_status',
200 'entity' => 'MembershipStatus',
201 'bao' => 'CRM_Member_BAO_MembershipStatus',
209 'name' => 'start_event',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Start Event'),
212 'description' => ts('Event when this status starts.'),
214 'size' => CRM_Utils_Type
::TWELVE
,
215 'where' => 'civicrm_membership_status.start_event',
216 'table_name' => 'civicrm_membership_status',
217 'entity' => 'MembershipStatus',
218 'bao' => 'CRM_Member_BAO_MembershipStatus',
223 'pseudoconstant' => [
224 'callback' => 'CRM_Core_SelectValues::eventDate',
228 'start_event_adjust_unit' => [
229 'name' => 'start_event_adjust_unit',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Start Event Adjust Unit'),
232 'description' => ts('Unit used for adjusting from start_event.'),
234 'size' => CRM_Utils_Type
::EIGHT
,
235 'where' => 'civicrm_membership_status.start_event_adjust_unit',
236 'table_name' => 'civicrm_membership_status',
237 'entity' => 'MembershipStatus',
238 'bao' => 'CRM_Member_BAO_MembershipStatus',
243 'pseudoconstant' => [
244 'callback' => 'CRM_Core_SelectValues::unitList',
248 'start_event_adjust_interval' => [
249 'name' => 'start_event_adjust_interval',
250 'type' => CRM_Utils_Type
::T_INT
,
251 'title' => ts('Start Event Adjust Interval'),
252 'description' => ts('Status range begins this many units from start_event.'),
253 'where' => 'civicrm_membership_status.start_event_adjust_interval',
254 'table_name' => 'civicrm_membership_status',
255 'entity' => 'MembershipStatus',
256 'bao' => 'CRM_Member_BAO_MembershipStatus',
261 'name' => 'end_event',
262 'type' => CRM_Utils_Type
::T_STRING
,
263 'title' => ts('End Event'),
264 'description' => ts('Event after which this status ends.'),
266 'size' => CRM_Utils_Type
::TWELVE
,
267 'where' => 'civicrm_membership_status.end_event',
268 'table_name' => 'civicrm_membership_status',
269 'entity' => 'MembershipStatus',
270 'bao' => 'CRM_Member_BAO_MembershipStatus',
275 'pseudoconstant' => [
276 'callback' => 'CRM_Core_SelectValues::eventDate',
280 'end_event_adjust_unit' => [
281 'name' => 'end_event_adjust_unit',
282 'type' => CRM_Utils_Type
::T_STRING
,
283 'title' => ts('End Event Adjust Unit'),
284 'description' => ts('Unit used for adjusting from the ending event.'),
286 'size' => CRM_Utils_Type
::EIGHT
,
287 'where' => 'civicrm_membership_status.end_event_adjust_unit',
288 'table_name' => 'civicrm_membership_status',
289 'entity' => 'MembershipStatus',
290 'bao' => 'CRM_Member_BAO_MembershipStatus',
295 'pseudoconstant' => [
296 'callback' => 'CRM_Core_SelectValues::unitList',
300 'end_event_adjust_interval' => [
301 'name' => 'end_event_adjust_interval',
302 'type' => CRM_Utils_Type
::T_INT
,
303 'title' => ts('End Event Adjust Interval'),
304 'description' => ts('Status range ends this many units from end_event.'),
305 'where' => 'civicrm_membership_status.end_event_adjust_interval',
306 'table_name' => 'civicrm_membership_status',
307 'entity' => 'MembershipStatus',
308 'bao' => 'CRM_Member_BAO_MembershipStatus',
312 'is_current_member' => [
313 'name' => 'is_current_member',
314 'type' => CRM_Utils_Type
::T_BOOLEAN
,
315 'title' => ts('Current Membership?'),
316 '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).'),
317 'where' => 'civicrm_membership_status.is_current_member',
318 'table_name' => 'civicrm_membership_status',
319 'entity' => 'MembershipStatus',
320 'bao' => 'CRM_Member_BAO_MembershipStatus',
325 'name' => 'is_admin',
326 'type' => CRM_Utils_Type
::T_BOOLEAN
,
327 'title' => ts('Administrator Only?'),
328 'description' => ts('Is this status for admin/manual assignment only.'),
329 'where' => 'civicrm_membership_status.is_admin',
330 'table_name' => 'civicrm_membership_status',
331 'entity' => 'MembershipStatus',
332 'bao' => 'CRM_Member_BAO_MembershipStatus',
335 'type' => 'CheckBox',
341 'type' => CRM_Utils_Type
::T_INT
,
342 'title' => ts('Order'),
343 'where' => 'civicrm_membership_status.weight',
344 'table_name' => 'civicrm_membership_status',
345 'entity' => 'MembershipStatus',
346 'bao' => 'CRM_Member_BAO_MembershipStatus',
351 'name' => 'is_default',
352 'type' => CRM_Utils_Type
::T_BOOLEAN
,
353 'title' => ts('Default Status?'),
354 'description' => ts('Assign this status to a membership record if no other status match is found.'),
355 'where' => 'civicrm_membership_status.is_default',
356 'table_name' => 'civicrm_membership_status',
357 'entity' => 'MembershipStatus',
358 'bao' => 'CRM_Member_BAO_MembershipStatus',
361 'type' => 'CheckBox',
366 'name' => 'is_active',
367 'type' => CRM_Utils_Type
::T_BOOLEAN
,
368 'title' => ts('Is Active'),
369 'description' => ts('Is this membership_status enabled.'),
370 'where' => 'civicrm_membership_status.is_active',
372 'table_name' => 'civicrm_membership_status',
373 'entity' => 'MembershipStatus',
374 'bao' => 'CRM_Member_BAO_MembershipStatus',
377 'type' => 'CheckBox',
382 'name' => 'is_reserved',
383 'type' => CRM_Utils_Type
::T_BOOLEAN
,
384 'title' => ts('Is Reserved'),
385 'description' => ts('Is this membership_status reserved.'),
386 'where' => 'civicrm_membership_status.is_reserved',
388 'table_name' => 'civicrm_membership_status',
389 'entity' => 'MembershipStatus',
390 'bao' => 'CRM_Member_BAO_MembershipStatus',
393 'type' => 'CheckBox',
398 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
400 return Civi
::$statics[__CLASS__
]['fields'];
404 * Return a mapping from field-name to the corresponding key (as used in fields()).
407 * Array(string $name => string $uniqueName).
409 public static function &fieldKeys() {
410 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
411 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
413 return Civi
::$statics[__CLASS__
]['fieldKeys'];
417 * Returns the names of this table
421 public static function getTableName() {
422 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
426 * Returns if this table needs to be logged
430 public function getLog() {
435 * Returns the list of fields that can be imported
437 * @param bool $prefix
441 public static function &import($prefix = FALSE) {
442 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, []);
447 * Returns the list of fields that can be exported
449 * @param bool $prefix
453 public static function &export($prefix = FALSE) {
454 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, []);
459 * Returns the list of indices
461 * @param bool $localize
465 public static function indices($localize = TRUE) {
467 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;