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:dfe977e53a6b66703ab4eca3560048e6)
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',
191 'name' => 'start_event',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Start Event'),
194 'description' => 'Event when this status starts.',
196 'size' => CRM_Utils_Type
::TWELVE
,
197 'table_name' => 'civicrm_membership_status',
198 'entity' => 'MembershipStatus',
199 'bao' => 'CRM_Member_BAO_MembershipStatus',
204 'pseudoconstant' => [
205 'callback' => 'CRM_Core_SelectValues::eventDate',
208 'start_event_adjust_unit' => [
209 'name' => 'start_event_adjust_unit',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Start Event Adjust Unit'),
212 'description' => 'Unit used for adjusting from start_event.',
214 'size' => CRM_Utils_Type
::EIGHT
,
215 'table_name' => 'civicrm_membership_status',
216 'entity' => 'MembershipStatus',
217 'bao' => 'CRM_Member_BAO_MembershipStatus',
222 'pseudoconstant' => [
223 'callback' => 'CRM_Core_SelectValues::unitList',
226 'start_event_adjust_interval' => [
227 'name' => 'start_event_adjust_interval',
228 'type' => CRM_Utils_Type
::T_INT
,
229 'title' => ts('Start Event Adjust Interval'),
230 'description' => 'Status range begins this many units from start_event.',
231 'table_name' => 'civicrm_membership_status',
232 'entity' => 'MembershipStatus',
233 'bao' => 'CRM_Member_BAO_MembershipStatus',
237 'name' => 'end_event',
238 'type' => CRM_Utils_Type
::T_STRING
,
239 'title' => ts('End Event'),
240 'description' => 'Event after which this status ends.',
242 'size' => CRM_Utils_Type
::TWELVE
,
243 'table_name' => 'civicrm_membership_status',
244 'entity' => 'MembershipStatus',
245 'bao' => 'CRM_Member_BAO_MembershipStatus',
250 'pseudoconstant' => [
251 'callback' => 'CRM_Core_SelectValues::eventDate',
254 'end_event_adjust_unit' => [
255 'name' => 'end_event_adjust_unit',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('End Event Adjust Unit'),
258 'description' => 'Unit used for adjusting from the ending event.',
260 'size' => CRM_Utils_Type
::EIGHT
,
261 'table_name' => 'civicrm_membership_status',
262 'entity' => 'MembershipStatus',
263 'bao' => 'CRM_Member_BAO_MembershipStatus',
268 'pseudoconstant' => [
269 'callback' => 'CRM_Core_SelectValues::unitList',
272 'end_event_adjust_interval' => [
273 'name' => 'end_event_adjust_interval',
274 'type' => CRM_Utils_Type
::T_INT
,
275 'title' => ts('End Event Adjust Interval'),
276 'description' => 'Status range ends this many units from end_event.',
277 'table_name' => 'civicrm_membership_status',
278 'entity' => 'MembershipStatus',
279 'bao' => 'CRM_Member_BAO_MembershipStatus',
282 'is_current_member' => [
283 'name' => 'is_current_member',
284 'type' => CRM_Utils_Type
::T_BOOLEAN
,
285 'title' => ts('Current Membership?'),
286 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
287 'table_name' => 'civicrm_membership_status',
288 'entity' => 'MembershipStatus',
289 'bao' => 'CRM_Member_BAO_MembershipStatus',
293 'name' => 'is_admin',
294 'type' => CRM_Utils_Type
::T_BOOLEAN
,
295 'title' => ts('Admin Assigned Only?'),
296 'description' => 'Is this status for admin/manual assignment only.',
297 'table_name' => 'civicrm_membership_status',
298 'entity' => 'MembershipStatus',
299 'bao' => 'CRM_Member_BAO_MembershipStatus',
304 'type' => CRM_Utils_Type
::T_INT
,
305 'title' => ts('Order'),
306 'table_name' => 'civicrm_membership_status',
307 'entity' => 'MembershipStatus',
308 'bao' => 'CRM_Member_BAO_MembershipStatus',
312 'name' => 'is_default',
313 'type' => CRM_Utils_Type
::T_BOOLEAN
,
314 'title' => ts('Default Status?'),
315 'description' => 'Assign this status to a membership record if no other status match is found.',
316 'table_name' => 'civicrm_membership_status',
317 'entity' => 'MembershipStatus',
318 'bao' => 'CRM_Member_BAO_MembershipStatus',
322 'name' => 'is_active',
323 'type' => CRM_Utils_Type
::T_BOOLEAN
,
324 'title' => ts('Is Active'),
325 'description' => 'Is this membership_status enabled.',
327 'table_name' => 'civicrm_membership_status',
328 'entity' => 'MembershipStatus',
329 'bao' => 'CRM_Member_BAO_MembershipStatus',
333 'name' => 'is_reserved',
334 'type' => CRM_Utils_Type
::T_BOOLEAN
,
335 'title' => ts('Is Reserved'),
336 'description' => 'Is this membership_status reserved.',
337 'table_name' => 'civicrm_membership_status',
338 'entity' => 'MembershipStatus',
339 'bao' => 'CRM_Member_BAO_MembershipStatus',
343 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
345 return Civi
::$statics[__CLASS__
]['fields'];
349 * Return a mapping from field-name to the corresponding key (as used in fields()).
352 * Array(string $name => string $uniqueName).
354 public static function &fieldKeys() {
355 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
356 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
358 return Civi
::$statics[__CLASS__
]['fieldKeys'];
362 * Returns the names of this table
366 public static function getTableName() {
367 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
371 * Returns if this table needs to be logged
375 public function getLog() {
380 * Returns the list of fields that can be imported
382 * @param bool $prefix
386 public static function &import($prefix = FALSE) {
387 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, []);
392 * Returns the list of fields that can be exported
394 * @param bool $prefix
398 public static function &export($prefix = FALSE) {
399 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, []);
404 * Returns the list of indices
406 * @param bool $localize
410 public static function indices($localize = TRUE) {
412 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;