3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:386d3a47b6acc84c75655d3682cc1403)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Member_DAO_MembershipStatus
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_membership_status';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Name for Membership Status
96 * Label for Membership Status
102 * Event when this status starts.
108 * Unit used for adjusting from start_event.
112 public $start_event_adjust_unit;
114 * Status range begins this many units from start_event.
118 public $start_event_adjust_interval;
120 * Event after which this status ends.
126 * Unit used for adjusting from the ending event.
130 public $end_event_adjust_unit;
132 * Status range ends this many units from end_event.
136 public $end_event_adjust_interval;
138 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
142 public $is_current_member;
144 * Is this status for admin/manual assignment only.
155 * Assign this status to a membership record if no other status match is found.
161 * Is this membership_status enabled.
167 * Is this membership_status reserved.
175 * @return civicrm_membership_status
177 function __construct() {
178 $this->__table
= 'civicrm_membership_status';
179 parent
::__construct();
182 * Returns all the column names of this table
186 static function &fields() {
187 if (!(self
::$_fields)) {
188 self
::$_fields = array(
191 'type' => CRM_Utils_Type
::T_INT
,
192 'title' => ts('Membership Status ID') ,
193 'description' => 'Membership Id',
196 'membership_status' => array(
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Membership Status') ,
200 'description' => 'Name for Membership Status',
202 'size' => CRM_Utils_Type
::HUGE
,
204 'where' => 'civicrm_membership_status.name',
205 'headerPattern' => '',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Label') ,
213 'description' => 'Label for Membership Status',
215 'size' => CRM_Utils_Type
::HUGE
,
217 'start_event' => array(
218 'name' => 'start_event',
219 'type' => CRM_Utils_Type
::T_STRING
,
220 'title' => ts('Start Event') ,
221 'description' => 'Event when this status starts.',
223 'size' => CRM_Utils_Type
::TWELVE
,
227 'pseudoconstant' => array(
228 'callback' => 'CRM_Core_SelectValues::eventDate',
231 'start_event_adjust_unit' => array(
232 'name' => 'start_event_adjust_unit',
233 'type' => CRM_Utils_Type
::T_STRING
,
234 'title' => ts('Start Event Adjust Unit') ,
235 'description' => 'Unit used for adjusting from start_event.',
237 'size' => CRM_Utils_Type
::EIGHT
,
241 'pseudoconstant' => array(
242 'callback' => 'CRM_Core_SelectValues::unitList',
245 'start_event_adjust_interval' => array(
246 'name' => 'start_event_adjust_interval',
247 'type' => CRM_Utils_Type
::T_INT
,
248 'title' => ts('Start Event Adjust Interval') ,
249 'description' => 'Status range begins this many units from start_event.',
251 'end_event' => array(
252 'name' => 'end_event',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('End Event') ,
255 'description' => 'Event after which this status ends.',
257 'size' => CRM_Utils_Type
::TWELVE
,
261 'pseudoconstant' => array(
262 'callback' => 'CRM_Core_SelectValues::eventDate',
265 'end_event_adjust_unit' => array(
266 'name' => 'end_event_adjust_unit',
267 'type' => CRM_Utils_Type
::T_STRING
,
268 'title' => ts('End Event Adjust Unit') ,
269 'description' => 'Unit used for adjusting from the ending event.',
271 'size' => CRM_Utils_Type
::EIGHT
,
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.',
285 'is_current_member' => array(
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).',
292 'name' => 'is_admin',
293 'type' => CRM_Utils_Type
::T_BOOLEAN
,
294 'title' => ts('Admin Assigned Only?') ,
295 'description' => 'Is this status for admin/manual assignment only.',
299 'type' => CRM_Utils_Type
::T_INT
,
300 'title' => ts('Order') ,
302 'is_default' => array(
303 'name' => 'is_default',
304 'type' => CRM_Utils_Type
::T_BOOLEAN
,
305 'title' => ts('Default Status?') ,
306 'description' => 'Assign this status to a membership record if no other status match is found.',
308 'is_active' => array(
309 'name' => 'is_active',
310 'type' => CRM_Utils_Type
::T_BOOLEAN
,
311 'title' => ts('Is Active') ,
312 'description' => 'Is this membership_status enabled.',
315 'is_reserved' => array(
316 'name' => 'is_reserved',
317 'type' => CRM_Utils_Type
::T_BOOLEAN
,
318 'title' => ts('Is Reserved') ,
319 'description' => 'Is this membership_status reserved.',
323 return self
::$_fields;
326 * Returns an array containing, for each field, the arary key used for that
327 * field in self::$_fields.
331 static function &fieldKeys() {
332 if (!(self
::$_fieldKeys)) {
333 self
::$_fieldKeys = array(
335 'name' => 'membership_status',
337 'start_event' => 'start_event',
338 'start_event_adjust_unit' => 'start_event_adjust_unit',
339 'start_event_adjust_interval' => 'start_event_adjust_interval',
340 'end_event' => 'end_event',
341 'end_event_adjust_unit' => 'end_event_adjust_unit',
342 'end_event_adjust_interval' => 'end_event_adjust_interval',
343 'is_current_member' => 'is_current_member',
344 'is_admin' => 'is_admin',
345 'weight' => 'weight',
346 'is_default' => 'is_default',
347 'is_active' => 'is_active',
348 'is_reserved' => 'is_reserved',
351 return self
::$_fieldKeys;
354 * Returns the names of this table
358 static function getTableName() {
359 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
362 * Returns if this table needs to be logged
370 * Returns the list of fields that can be imported
372 * @param bool $prefix
376 static function &import($prefix = false) {
377 if (!(self
::$_import)) {
378 self
::$_import = array();
379 $fields = self
::fields();
380 foreach($fields as $name => $field) {
381 if (CRM_Utils_Array
::value('import', $field)) {
383 self
::$_import['membership_status'] = & $fields[$name];
385 self
::$_import[$name] = & $fields[$name];
390 return self
::$_import;
393 * Returns the list of fields that can be exported
395 * @param bool $prefix
399 static function &export($prefix = false) {
400 if (!(self
::$_export)) {
401 self
::$_export = array();
402 $fields = self
::fields();
403 foreach($fields as $name => $field) {
404 if (CRM_Utils_Array
::value('export', $field)) {
406 self
::$_export['membership_status'] = & $fields[$name];
408 self
::$_export[$name] = & $fields[$name];
413 return self
::$_export;