3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:dfe977e53a6b66703ab4eca3560048e6)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Member_DAO_MembershipStatus constructor.
40 class CRM_Member_DAO_MembershipStatus
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_membership_status';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Name for Membership Status
66 * Label for Membership Status
72 * Event when this status starts.
78 * Unit used for adjusting from start_event.
82 public $start_event_adjust_unit;
84 * Status range begins this many units from start_event.
88 public $start_event_adjust_interval;
90 * Event after which this status ends.
96 * Unit used for adjusting from the ending event.
100 public $end_event_adjust_unit;
102 * Status range ends this many units from end_event.
106 public $end_event_adjust_interval;
108 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
112 public $is_current_member;
114 * Is this status for admin/manual assignment only.
125 * Assign this status to a membership record if no other status match is found.
131 * Is this membership_status enabled.
137 * Is this membership_status reserved.
145 function __construct() {
146 $this->__table
= 'civicrm_membership_status';
147 parent
::__construct();
150 * Returns all the column names of this table
154 static function &fields() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
156 Civi
::$statics[__CLASS__
]['fields'] = array(
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Membership Status ID') ,
161 'description' => 'Membership Id',
163 'table_name' => 'civicrm_membership_status',
164 'entity' => 'MembershipStatus',
165 'bao' => 'CRM_Member_BAO_MembershipStatus',
168 'membership_status' => array(
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Membership Status') ,
172 'description' => 'Name for Membership Status',
174 'size' => CRM_Utils_Type
::HUGE
,
176 'where' => 'civicrm_membership_status.name',
177 'headerPattern' => '',
180 'table_name' => 'civicrm_membership_status',
181 'entity' => 'MembershipStatus',
182 'bao' => 'CRM_Member_BAO_MembershipStatus',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Label') ,
189 'description' => 'Label for Membership Status',
191 'size' => CRM_Utils_Type
::HUGE
,
192 'table_name' => 'civicrm_membership_status',
193 'entity' => 'MembershipStatus',
194 'bao' => 'CRM_Member_BAO_MembershipStatus',
197 'start_event' => array(
198 'name' => 'start_event',
199 'type' => CRM_Utils_Type
::T_STRING
,
200 'title' => ts('Start Event') ,
201 'description' => 'Event when this status starts.',
203 'size' => CRM_Utils_Type
::TWELVE
,
204 'table_name' => 'civicrm_membership_status',
205 'entity' => 'MembershipStatus',
206 'bao' => 'CRM_Member_BAO_MembershipStatus',
211 'pseudoconstant' => array(
212 'callback' => 'CRM_Core_SelectValues::eventDate',
215 'start_event_adjust_unit' => array(
216 'name' => 'start_event_adjust_unit',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('Start Event Adjust Unit') ,
219 'description' => 'Unit used for adjusting from start_event.',
221 'size' => CRM_Utils_Type
::EIGHT
,
222 'table_name' => 'civicrm_membership_status',
223 'entity' => 'MembershipStatus',
224 'bao' => 'CRM_Member_BAO_MembershipStatus',
229 'pseudoconstant' => array(
230 'callback' => 'CRM_Core_SelectValues::unitList',
233 'start_event_adjust_interval' => array(
234 'name' => 'start_event_adjust_interval',
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Start Event Adjust Interval') ,
237 'description' => 'Status range begins this many units from start_event.',
238 'table_name' => 'civicrm_membership_status',
239 'entity' => 'MembershipStatus',
240 'bao' => 'CRM_Member_BAO_MembershipStatus',
243 'end_event' => array(
244 'name' => 'end_event',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('End Event') ,
247 'description' => 'Event after which this status ends.',
249 'size' => CRM_Utils_Type
::TWELVE
,
250 'table_name' => 'civicrm_membership_status',
251 'entity' => 'MembershipStatus',
252 'bao' => 'CRM_Member_BAO_MembershipStatus',
257 'pseudoconstant' => array(
258 'callback' => 'CRM_Core_SelectValues::eventDate',
261 'end_event_adjust_unit' => array(
262 'name' => 'end_event_adjust_unit',
263 'type' => CRM_Utils_Type
::T_STRING
,
264 'title' => ts('End Event Adjust Unit') ,
265 'description' => 'Unit used for adjusting from the ending event.',
267 'size' => CRM_Utils_Type
::EIGHT
,
268 'table_name' => 'civicrm_membership_status',
269 'entity' => 'MembershipStatus',
270 'bao' => 'CRM_Member_BAO_MembershipStatus',
275 'pseudoconstant' => array(
276 'callback' => 'CRM_Core_SelectValues::unitList',
279 'end_event_adjust_interval' => array(
280 'name' => 'end_event_adjust_interval',
281 'type' => CRM_Utils_Type
::T_INT
,
282 'title' => ts('End Event Adjust Interval') ,
283 'description' => 'Status range ends this many units from end_event.',
284 'table_name' => 'civicrm_membership_status',
285 'entity' => 'MembershipStatus',
286 'bao' => 'CRM_Member_BAO_MembershipStatus',
289 'is_current_member' => array(
290 'name' => 'is_current_member',
291 'type' => CRM_Utils_Type
::T_BOOLEAN
,
292 'title' => ts('Current Membership?') ,
293 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
294 'table_name' => 'civicrm_membership_status',
295 'entity' => 'MembershipStatus',
296 'bao' => 'CRM_Member_BAO_MembershipStatus',
300 'name' => 'is_admin',
301 'type' => CRM_Utils_Type
::T_BOOLEAN
,
302 'title' => ts('Admin Assigned Only?') ,
303 'description' => 'Is this status for admin/manual assignment only.',
304 'table_name' => 'civicrm_membership_status',
305 'entity' => 'MembershipStatus',
306 'bao' => 'CRM_Member_BAO_MembershipStatus',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Order') ,
313 'table_name' => 'civicrm_membership_status',
314 'entity' => 'MembershipStatus',
315 'bao' => 'CRM_Member_BAO_MembershipStatus',
318 'is_default' => array(
319 'name' => 'is_default',
320 'type' => CRM_Utils_Type
::T_BOOLEAN
,
321 'title' => ts('Default Status?') ,
322 'description' => 'Assign this status to a membership record if no other status match is found.',
323 'table_name' => 'civicrm_membership_status',
324 'entity' => 'MembershipStatus',
325 'bao' => 'CRM_Member_BAO_MembershipStatus',
328 'is_active' => array(
329 'name' => 'is_active',
330 'type' => CRM_Utils_Type
::T_BOOLEAN
,
331 'title' => ts('Is Active') ,
332 'description' => 'Is this membership_status enabled.',
334 'table_name' => 'civicrm_membership_status',
335 'entity' => 'MembershipStatus',
336 'bao' => 'CRM_Member_BAO_MembershipStatus',
339 'is_reserved' => array(
340 'name' => 'is_reserved',
341 'type' => CRM_Utils_Type
::T_BOOLEAN
,
342 'title' => ts('Is Reserved') ,
343 'description' => 'Is this membership_status reserved.',
344 'table_name' => 'civicrm_membership_status',
345 'entity' => 'MembershipStatus',
346 'bao' => 'CRM_Member_BAO_MembershipStatus',
350 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
352 return Civi
::$statics[__CLASS__
]['fields'];
355 * Return a mapping from field-name to the corresponding key (as used in fields()).
358 * Array(string $name => string $uniqueName).
360 static function &fieldKeys() {
361 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
362 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
364 return Civi
::$statics[__CLASS__
]['fieldKeys'];
367 * Returns the names of this table
371 static function getTableName() {
372 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
375 * Returns if this table needs to be logged
383 * Returns the list of fields that can be imported
385 * @param bool $prefix
389 static function &import($prefix = false) {
390 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_status', $prefix, array());
394 * Returns the list of fields that can be exported
396 * @param bool $prefix
400 static function &export($prefix = false) {
401 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_status', $prefix, array());