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:f0c470d5aca6e3696a0ad8345531f8b8)
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 public static function getEntityTitle() {
148 return ts('Membership Statuses');
152 * Returns all the column names of this table
156 public static function &fields() {
157 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
158 Civi
::$statics[__CLASS__
]['fields'] = [
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Membership Status ID'),
163 'description' => ts('Membership Id'),
165 'where' => 'civicrm_membership_status.id',
166 'table_name' => 'civicrm_membership_status',
167 'entity' => 'MembershipStatus',
168 'bao' => 'CRM_Member_BAO_MembershipStatus',
172 'membership_status' => [
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Membership Status'),
176 'description' => ts('Name for Membership Status'),
178 'size' => CRM_Utils_Type
::HUGE
,
180 'where' => 'civicrm_membership_status.name',
182 'table_name' => 'civicrm_membership_status',
183 'entity' => 'MembershipStatus',
184 'bao' => 'CRM_Member_BAO_MembershipStatus',
190 'type' => CRM_Utils_Type
::T_STRING
,
191 'title' => ts('Label'),
192 'description' => ts('Label for Membership Status'),
194 'size' => CRM_Utils_Type
::HUGE
,
195 'where' => 'civicrm_membership_status.label',
196 'table_name' => 'civicrm_membership_status',
197 'entity' => 'MembershipStatus',
198 'bao' => 'CRM_Member_BAO_MembershipStatus',
206 'name' => 'start_event',
207 'type' => CRM_Utils_Type
::T_STRING
,
208 'title' => ts('Start Event'),
209 'description' => ts('Event when this status starts.'),
211 'size' => CRM_Utils_Type
::TWELVE
,
212 'where' => 'civicrm_membership_status.start_event',
213 'table_name' => 'civicrm_membership_status',
214 'entity' => 'MembershipStatus',
215 'bao' => 'CRM_Member_BAO_MembershipStatus',
220 'pseudoconstant' => [
221 'callback' => 'CRM_Core_SelectValues::eventDate',
225 'start_event_adjust_unit' => [
226 'name' => 'start_event_adjust_unit',
227 'type' => CRM_Utils_Type
::T_STRING
,
228 'title' => ts('Start Event Adjust Unit'),
229 'description' => ts('Unit used for adjusting from start_event.'),
231 'size' => CRM_Utils_Type
::EIGHT
,
232 'where' => 'civicrm_membership_status.start_event_adjust_unit',
233 'table_name' => 'civicrm_membership_status',
234 'entity' => 'MembershipStatus',
235 'bao' => 'CRM_Member_BAO_MembershipStatus',
240 'pseudoconstant' => [
241 'callback' => 'CRM_Core_SelectValues::unitList',
245 'start_event_adjust_interval' => [
246 'name' => 'start_event_adjust_interval',
247 'type' => CRM_Utils_Type
::T_INT
,
248 'title' => ts('Start Event Adjust Interval'),
249 'description' => ts('Status range begins this many units from start_event.'),
250 'where' => 'civicrm_membership_status.start_event_adjust_interval',
251 'table_name' => 'civicrm_membership_status',
252 'entity' => 'MembershipStatus',
253 'bao' => 'CRM_Member_BAO_MembershipStatus',
258 'name' => 'end_event',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('End Event'),
261 'description' => ts('Event after which this status ends.'),
263 'size' => CRM_Utils_Type
::TWELVE
,
264 'where' => 'civicrm_membership_status.end_event',
265 'table_name' => 'civicrm_membership_status',
266 'entity' => 'MembershipStatus',
267 'bao' => 'CRM_Member_BAO_MembershipStatus',
272 'pseudoconstant' => [
273 'callback' => 'CRM_Core_SelectValues::eventDate',
277 'end_event_adjust_unit' => [
278 'name' => 'end_event_adjust_unit',
279 'type' => CRM_Utils_Type
::T_STRING
,
280 'title' => ts('End Event Adjust Unit'),
281 'description' => ts('Unit used for adjusting from the ending event.'),
283 'size' => CRM_Utils_Type
::EIGHT
,
284 'where' => 'civicrm_membership_status.end_event_adjust_unit',
285 'table_name' => 'civicrm_membership_status',
286 'entity' => 'MembershipStatus',
287 'bao' => 'CRM_Member_BAO_MembershipStatus',
292 'pseudoconstant' => [
293 'callback' => 'CRM_Core_SelectValues::unitList',
297 'end_event_adjust_interval' => [
298 'name' => 'end_event_adjust_interval',
299 'type' => CRM_Utils_Type
::T_INT
,
300 'title' => ts('End Event Adjust Interval'),
301 'description' => ts('Status range ends this many units from end_event.'),
302 'where' => 'civicrm_membership_status.end_event_adjust_interval',
303 'table_name' => 'civicrm_membership_status',
304 'entity' => 'MembershipStatus',
305 'bao' => 'CRM_Member_BAO_MembershipStatus',
309 'is_current_member' => [
310 'name' => 'is_current_member',
311 'type' => CRM_Utils_Type
::T_BOOLEAN
,
312 'title' => ts('Current Membership?'),
313 '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).'),
314 'where' => 'civicrm_membership_status.is_current_member',
315 'table_name' => 'civicrm_membership_status',
316 'entity' => 'MembershipStatus',
317 'bao' => 'CRM_Member_BAO_MembershipStatus',
322 'name' => 'is_admin',
323 'type' => CRM_Utils_Type
::T_BOOLEAN
,
324 'title' => ts('Administrator Only?'),
325 'description' => ts('Is this status for admin/manual assignment only.'),
326 'where' => 'civicrm_membership_status.is_admin',
327 'table_name' => 'civicrm_membership_status',
328 'entity' => 'MembershipStatus',
329 'bao' => 'CRM_Member_BAO_MembershipStatus',
332 'type' => 'CheckBox',
338 'type' => CRM_Utils_Type
::T_INT
,
339 'title' => ts('Order'),
340 'where' => 'civicrm_membership_status.weight',
341 'table_name' => 'civicrm_membership_status',
342 'entity' => 'MembershipStatus',
343 'bao' => 'CRM_Member_BAO_MembershipStatus',
348 'name' => 'is_default',
349 'type' => CRM_Utils_Type
::T_BOOLEAN
,
350 'title' => ts('Default Status?'),
351 'description' => ts('Assign this status to a membership record if no other status match is found.'),
352 'where' => 'civicrm_membership_status.is_default',
353 'table_name' => 'civicrm_membership_status',
354 'entity' => 'MembershipStatus',
355 'bao' => 'CRM_Member_BAO_MembershipStatus',
358 'type' => 'CheckBox',
363 'name' => 'is_active',
364 'type' => CRM_Utils_Type
::T_BOOLEAN
,
365 'title' => ts('Is Active'),
366 'description' => ts('Is this membership_status enabled.'),
367 'where' => 'civicrm_membership_status.is_active',
369 'table_name' => 'civicrm_membership_status',
370 'entity' => 'MembershipStatus',
371 'bao' => 'CRM_Member_BAO_MembershipStatus',
374 'type' => 'CheckBox',
379 'name' => 'is_reserved',
380 'type' => CRM_Utils_Type
::T_BOOLEAN
,
381 'title' => ts('Is Reserved'),
382 'description' => ts('Is this membership_status reserved.'),
383 'where' => 'civicrm_membership_status.is_reserved',
385 'table_name' => 'civicrm_membership_status',
386 'entity' => 'MembershipStatus',
387 'bao' => 'CRM_Member_BAO_MembershipStatus',
390 'type' => 'CheckBox',
395 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
397 return Civi
::$statics[__CLASS__
]['fields'];
401 * Return a mapping from field-name to the corresponding key (as used in fields()).
404 * Array(string $name => string $uniqueName).
406 public static function &fieldKeys() {
407 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
408 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
410 return Civi
::$statics[__CLASS__
]['fieldKeys'];
414 * Returns the names of this table
418 public static function getTableName() {
419 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
423 * Returns if this table needs to be logged
427 public function getLog() {
432 * Returns the list of fields that can be imported
434 * @param bool $prefix
438 public static function &import($prefix = FALSE) {
439 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, []);
444 * Returns the list of fields that can be exported
446 * @param bool $prefix
450 public static function &export($prefix = FALSE) {
451 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, []);
456 * Returns the list of indices
458 * @param bool $localize
462 public static function indices($localize = TRUE) {
464 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;