5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0cb23348cde6fff261da37c8cb309da1)
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 all the column names of this table
147 public static function &fields() {
148 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
149 Civi
::$statics[__CLASS__
]['fields'] = [
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Membership Status ID'),
154 'description' => ts('Membership Id'),
156 'where' => 'civicrm_membership_status.id',
157 'table_name' => 'civicrm_membership_status',
158 'entity' => 'MembershipStatus',
159 'bao' => 'CRM_Member_BAO_MembershipStatus',
162 'membership_status' => [
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'title' => ts('Membership Status'),
166 'description' => ts('Name for Membership Status'),
168 'size' => CRM_Utils_Type
::HUGE
,
170 'where' => 'civicrm_membership_status.name',
172 'table_name' => 'civicrm_membership_status',
173 'entity' => 'MembershipStatus',
174 'bao' => 'CRM_Member_BAO_MembershipStatus',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('Label'),
181 'description' => ts('Label for Membership Status'),
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',
194 'name' => 'start_event',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('Start Event'),
197 'description' => ts('Event when this status starts.'),
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',
208 'pseudoconstant' => [
209 'callback' => 'CRM_Core_SelectValues::eventDate',
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.'),
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',
227 'pseudoconstant' => [
228 'callback' => 'CRM_Core_SelectValues::unitList',
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',
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.'),
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',
257 'pseudoconstant' => [
258 'callback' => 'CRM_Core_SelectValues::eventDate',
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.'),
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',
276 'pseudoconstant' => [
277 'callback' => 'CRM_Core_SelectValues::unitList',
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',
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',
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',
313 'type' => 'CheckBox',
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',
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',
337 'type' => 'CheckBox',
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',
347 'table_name' => 'civicrm_membership_status',
348 'entity' => 'MembershipStatus',
349 'bao' => 'CRM_Member_BAO_MembershipStatus',
352 'type' => 'CheckBox',
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',
362 'table_name' => 'civicrm_membership_status',
363 'entity' => 'MembershipStatus',
364 'bao' => 'CRM_Member_BAO_MembershipStatus',
367 'type' => 'CheckBox',
371 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
373 return Civi
::$statics[__CLASS__
]['fields'];
377 * Return a mapping from field-name to the corresponding key (as used in fields()).
380 * Array(string $name => string $uniqueName).
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()));
386 return Civi
::$statics[__CLASS__
]['fieldKeys'];
390 * Returns the names of this table
394 public static function getTableName() {
395 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
399 * Returns if this table needs to be logged
403 public function getLog() {
408 * Returns the list of fields that can be imported
410 * @param bool $prefix
414 public static function &import($prefix = FALSE) {
415 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, []);
420 * Returns the list of fields that can be exported
422 * @param bool $prefix
426 public static function &export($prefix = FALSE) {
427 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, []);
432 * Returns the list of indices
434 * @param bool $localize
438 public static function indices($localize = TRUE) {
440 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;