5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ea7435287a239f4851dd354150980069)
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 static $_tableName = 'civicrm_membership_status';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Membership Id',
156 'table_name' => 'civicrm_membership_status',
157 'entity' => 'MembershipStatus',
158 'bao' => 'CRM_Member_BAO_MembershipStatus',
161 'membership_status' => [
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Membership Status'),
165 'description' => 'Name for Membership Status',
167 'size' => CRM_Utils_Type
::HUGE
,
169 'where' => 'civicrm_membership_status.name',
170 'headerPattern' => '',
173 'table_name' => 'civicrm_membership_status',
174 'entity' => 'MembershipStatus',
175 'bao' => 'CRM_Member_BAO_MembershipStatus',
180 'type' => CRM_Utils_Type
::T_STRING
,
181 'title' => ts('Label'),
182 'description' => 'Label for Membership Status',
184 'size' => CRM_Utils_Type
::HUGE
,
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' => 'Event when this status starts.',
199 'size' => CRM_Utils_Type
::TWELVE
,
200 'table_name' => 'civicrm_membership_status',
201 'entity' => 'MembershipStatus',
202 'bao' => 'CRM_Member_BAO_MembershipStatus',
207 'pseudoconstant' => [
208 'callback' => 'CRM_Core_SelectValues::eventDate',
211 'start_event_adjust_unit' => [
212 'name' => 'start_event_adjust_unit',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Start Event Adjust Unit'),
215 'description' => 'Unit used for adjusting from start_event.',
217 'size' => CRM_Utils_Type
::EIGHT
,
218 'table_name' => 'civicrm_membership_status',
219 'entity' => 'MembershipStatus',
220 'bao' => 'CRM_Member_BAO_MembershipStatus',
225 'pseudoconstant' => [
226 'callback' => 'CRM_Core_SelectValues::unitList',
229 'start_event_adjust_interval' => [
230 'name' => 'start_event_adjust_interval',
231 'type' => CRM_Utils_Type
::T_INT
,
232 'title' => ts('Start Event Adjust Interval'),
233 'description' => 'Status range begins this many units from start_event.',
234 'table_name' => 'civicrm_membership_status',
235 'entity' => 'MembershipStatus',
236 'bao' => 'CRM_Member_BAO_MembershipStatus',
240 'name' => 'end_event',
241 'type' => CRM_Utils_Type
::T_STRING
,
242 'title' => ts('End Event'),
243 'description' => 'Event after which this status ends.',
245 'size' => CRM_Utils_Type
::TWELVE
,
246 'table_name' => 'civicrm_membership_status',
247 'entity' => 'MembershipStatus',
248 'bao' => 'CRM_Member_BAO_MembershipStatus',
253 'pseudoconstant' => [
254 'callback' => 'CRM_Core_SelectValues::eventDate',
257 'end_event_adjust_unit' => [
258 'name' => 'end_event_adjust_unit',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('End Event Adjust Unit'),
261 'description' => 'Unit used for adjusting from the ending event.',
263 'size' => CRM_Utils_Type
::EIGHT
,
264 'table_name' => 'civicrm_membership_status',
265 'entity' => 'MembershipStatus',
266 'bao' => 'CRM_Member_BAO_MembershipStatus',
271 'pseudoconstant' => [
272 'callback' => 'CRM_Core_SelectValues::unitList',
275 'end_event_adjust_interval' => [
276 'name' => 'end_event_adjust_interval',
277 'type' => CRM_Utils_Type
::T_INT
,
278 'title' => ts('End Event Adjust Interval'),
279 'description' => 'Status range ends this many units from end_event.',
280 'table_name' => 'civicrm_membership_status',
281 'entity' => 'MembershipStatus',
282 'bao' => 'CRM_Member_BAO_MembershipStatus',
285 'is_current_member' => [
286 'name' => 'is_current_member',
287 'type' => CRM_Utils_Type
::T_BOOLEAN
,
288 'title' => ts('Current Membership?'),
289 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
290 'table_name' => 'civicrm_membership_status',
291 'entity' => 'MembershipStatus',
292 'bao' => 'CRM_Member_BAO_MembershipStatus',
296 'name' => 'is_admin',
297 'type' => CRM_Utils_Type
::T_BOOLEAN
,
298 'title' => ts('Administrator Only?'),
299 'description' => 'Is this status for admin/manual assignment only.',
300 'table_name' => 'civicrm_membership_status',
301 'entity' => 'MembershipStatus',
302 'bao' => 'CRM_Member_BAO_MembershipStatus',
305 'type' => 'CheckBox',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Order'),
312 'table_name' => 'civicrm_membership_status',
313 'entity' => 'MembershipStatus',
314 'bao' => 'CRM_Member_BAO_MembershipStatus',
318 'name' => 'is_default',
319 'type' => CRM_Utils_Type
::T_BOOLEAN
,
320 'title' => ts('Default Status?'),
321 'description' => 'Assign this status to a membership record if no other status match is found.',
322 'table_name' => 'civicrm_membership_status',
323 'entity' => 'MembershipStatus',
324 'bao' => 'CRM_Member_BAO_MembershipStatus',
327 'type' => 'CheckBox',
331 'name' => 'is_active',
332 'type' => CRM_Utils_Type
::T_BOOLEAN
,
333 'title' => ts('Is Active'),
334 'description' => 'Is this membership_status enabled.',
336 'table_name' => 'civicrm_membership_status',
337 'entity' => 'MembershipStatus',
338 'bao' => 'CRM_Member_BAO_MembershipStatus',
341 'type' => 'CheckBox',
345 'name' => 'is_reserved',
346 'type' => CRM_Utils_Type
::T_BOOLEAN
,
347 'title' => ts('Is Reserved'),
348 'description' => 'Is this membership_status reserved.',
349 'table_name' => 'civicrm_membership_status',
350 'entity' => 'MembershipStatus',
351 'bao' => 'CRM_Member_BAO_MembershipStatus',
354 'type' => 'CheckBox',
358 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
360 return Civi
::$statics[__CLASS__
]['fields'];
364 * Return a mapping from field-name to the corresponding key (as used in fields()).
367 * Array(string $name => string $uniqueName).
369 public static function &fieldKeys() {
370 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
371 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
373 return Civi
::$statics[__CLASS__
]['fieldKeys'];
377 * Returns the names of this table
381 public static function getTableName() {
382 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
386 * Returns if this table needs to be logged
390 public function getLog() {
395 * Returns the list of fields that can be imported
397 * @param bool $prefix
401 public static function &import($prefix = FALSE) {
402 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, []);
407 * Returns the list of fields that can be exported
409 * @param bool $prefix
413 public static function &export($prefix = FALSE) {
414 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, []);
419 * Returns the list of indices
421 * @param bool $localize
425 public static function indices($localize = TRUE) {
427 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;