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:e6fe414d2b0dc3ff72ee5adcad75fab8)
13 * Database access object for the MembershipStatus entity.
15 class CRM_Member_DAO_MembershipStatus
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_membership_status';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * Name for Membership Status
46 * Label for Membership Status
53 * Event when this status starts.
60 * Unit used for adjusting from start_event.
64 public $start_event_adjust_unit;
67 * Status range begins this many units from start_event.
71 public $start_event_adjust_interval;
74 * Event after which this status ends.
81 * Unit used for adjusting from the ending event.
85 public $end_event_adjust_unit;
88 * Status range ends this many units from end_event.
92 public $end_event_adjust_interval;
95 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
99 public $is_current_member;
102 * Is this status for admin/manual assignment only.
114 * Assign this status to a membership record if no other status match is found.
121 * Is this membership_status enabled.
128 * Is this membership_status reserved.
137 public function __construct() {
138 $this->__table
= 'civicrm_membership_status';
139 parent
::__construct();
143 * Returns localized title of this entity.
145 public static function getEntityTitle() {
146 return ts('Membership Statuses');
150 * Returns all the column names of this table
154 public static function &fields() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
156 Civi
::$statics[__CLASS__
]['fields'] = [
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Membership Status ID'),
161 'description' => ts('Membership Id'),
163 'where' => 'civicrm_membership_status.id',
164 'table_name' => 'civicrm_membership_status',
165 'entity' => 'MembershipStatus',
166 'bao' => 'CRM_Member_BAO_MembershipStatus',
170 'membership_status' => [
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Membership Status'),
174 'description' => ts('Name for Membership Status'),
176 'size' => CRM_Utils_Type
::HUGE
,
178 'where' => 'civicrm_membership_status.name',
180 'table_name' => 'civicrm_membership_status',
181 'entity' => 'MembershipStatus',
182 'bao' => 'CRM_Member_BAO_MembershipStatus',
188 'type' => CRM_Utils_Type
::T_STRING
,
189 'title' => ts('Label'),
190 'description' => ts('Label for Membership Status'),
192 'size' => CRM_Utils_Type
::HUGE
,
193 'where' => 'civicrm_membership_status.label',
194 'table_name' => 'civicrm_membership_status',
195 'entity' => 'MembershipStatus',
196 'bao' => 'CRM_Member_BAO_MembershipStatus',
204 'name' => 'start_event',
205 'type' => CRM_Utils_Type
::T_STRING
,
206 'title' => ts('Start Event'),
207 'description' => ts('Event when this status starts.'),
209 'size' => CRM_Utils_Type
::TWELVE
,
210 'where' => 'civicrm_membership_status.start_event',
211 'table_name' => 'civicrm_membership_status',
212 'entity' => 'MembershipStatus',
213 'bao' => 'CRM_Member_BAO_MembershipStatus',
218 'pseudoconstant' => [
219 'callback' => 'CRM_Core_SelectValues::eventDate',
223 'start_event_adjust_unit' => [
224 'name' => 'start_event_adjust_unit',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Start Event Adjust Unit'),
227 'description' => ts('Unit used for adjusting from start_event.'),
229 'size' => CRM_Utils_Type
::EIGHT
,
230 'where' => 'civicrm_membership_status.start_event_adjust_unit',
231 'table_name' => 'civicrm_membership_status',
232 'entity' => 'MembershipStatus',
233 'bao' => 'CRM_Member_BAO_MembershipStatus',
238 'pseudoconstant' => [
239 'callback' => 'CRM_Core_SelectValues::unitList',
243 'start_event_adjust_interval' => [
244 'name' => 'start_event_adjust_interval',
245 'type' => CRM_Utils_Type
::T_INT
,
246 'title' => ts('Start Event Adjust Interval'),
247 'description' => ts('Status range begins this many units from start_event.'),
248 'where' => 'civicrm_membership_status.start_event_adjust_interval',
249 'table_name' => 'civicrm_membership_status',
250 'entity' => 'MembershipStatus',
251 'bao' => 'CRM_Member_BAO_MembershipStatus',
256 'name' => 'end_event',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('End Event'),
259 'description' => ts('Event after which this status ends.'),
261 'size' => CRM_Utils_Type
::TWELVE
,
262 'where' => 'civicrm_membership_status.end_event',
263 'table_name' => 'civicrm_membership_status',
264 'entity' => 'MembershipStatus',
265 'bao' => 'CRM_Member_BAO_MembershipStatus',
270 'pseudoconstant' => [
271 'callback' => 'CRM_Core_SelectValues::eventDate',
275 'end_event_adjust_unit' => [
276 'name' => 'end_event_adjust_unit',
277 'type' => CRM_Utils_Type
::T_STRING
,
278 'title' => ts('End Event Adjust Unit'),
279 'description' => ts('Unit used for adjusting from the ending event.'),
281 'size' => CRM_Utils_Type
::EIGHT
,
282 'where' => 'civicrm_membership_status.end_event_adjust_unit',
283 'table_name' => 'civicrm_membership_status',
284 'entity' => 'MembershipStatus',
285 'bao' => 'CRM_Member_BAO_MembershipStatus',
290 'pseudoconstant' => [
291 'callback' => 'CRM_Core_SelectValues::unitList',
295 'end_event_adjust_interval' => [
296 'name' => 'end_event_adjust_interval',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('End Event Adjust Interval'),
299 'description' => ts('Status range ends this many units from end_event.'),
300 'where' => 'civicrm_membership_status.end_event_adjust_interval',
301 'table_name' => 'civicrm_membership_status',
302 'entity' => 'MembershipStatus',
303 'bao' => 'CRM_Member_BAO_MembershipStatus',
307 'is_current_member' => [
308 'name' => 'is_current_member',
309 'type' => CRM_Utils_Type
::T_BOOLEAN
,
310 'title' => ts('Current Membership?'),
311 '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).'),
312 'where' => 'civicrm_membership_status.is_current_member',
313 'table_name' => 'civicrm_membership_status',
314 'entity' => 'MembershipStatus',
315 'bao' => 'CRM_Member_BAO_MembershipStatus',
320 'name' => 'is_admin',
321 'type' => CRM_Utils_Type
::T_BOOLEAN
,
322 'title' => ts('Administrator Only?'),
323 'description' => ts('Is this status for admin/manual assignment only.'),
324 'where' => 'civicrm_membership_status.is_admin',
325 'table_name' => 'civicrm_membership_status',
326 'entity' => 'MembershipStatus',
327 'bao' => 'CRM_Member_BAO_MembershipStatus',
330 'type' => 'CheckBox',
336 'type' => CRM_Utils_Type
::T_INT
,
337 'title' => ts('Order'),
338 'where' => 'civicrm_membership_status.weight',
339 'table_name' => 'civicrm_membership_status',
340 'entity' => 'MembershipStatus',
341 'bao' => 'CRM_Member_BAO_MembershipStatus',
346 'name' => 'is_default',
347 'type' => CRM_Utils_Type
::T_BOOLEAN
,
348 'title' => ts('Default Status?'),
349 'description' => ts('Assign this status to a membership record if no other status match is found.'),
350 'where' => 'civicrm_membership_status.is_default',
351 'table_name' => 'civicrm_membership_status',
352 'entity' => 'MembershipStatus',
353 'bao' => 'CRM_Member_BAO_MembershipStatus',
356 'type' => 'CheckBox',
361 'name' => 'is_active',
362 'type' => CRM_Utils_Type
::T_BOOLEAN
,
363 'title' => ts('Is Active'),
364 'description' => ts('Is this membership_status enabled.'),
365 'where' => 'civicrm_membership_status.is_active',
367 'table_name' => 'civicrm_membership_status',
368 'entity' => 'MembershipStatus',
369 'bao' => 'CRM_Member_BAO_MembershipStatus',
372 'type' => 'CheckBox',
377 'name' => 'is_reserved',
378 'type' => CRM_Utils_Type
::T_BOOLEAN
,
379 'title' => ts('Is Reserved'),
380 'description' => ts('Is this membership_status reserved.'),
381 'where' => 'civicrm_membership_status.is_reserved',
383 'table_name' => 'civicrm_membership_status',
384 'entity' => 'MembershipStatus',
385 'bao' => 'CRM_Member_BAO_MembershipStatus',
388 'type' => 'CheckBox',
393 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
395 return Civi
::$statics[__CLASS__
]['fields'];
399 * Return a mapping from field-name to the corresponding key (as used in fields()).
402 * Array(string $name => string $uniqueName).
404 public static function &fieldKeys() {
405 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
406 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
408 return Civi
::$statics[__CLASS__
]['fieldKeys'];
412 * Returns the names of this table
416 public static function getTableName() {
417 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
421 * Returns if this table needs to be logged
425 public function getLog() {
430 * Returns the list of fields that can be imported
432 * @param bool $prefix
436 public static function &import($prefix = FALSE) {
437 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, []);
442 * Returns the list of fields that can be exported
444 * @param bool $prefix
448 public static function &export($prefix = FALSE) {
449 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, []);
454 * Returns the list of indices
456 * @param bool $localize
460 public static function indices($localize = TRUE) {
462 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;