Merge pull request #9599 from colemanw/CRM-19812
[civicrm-core.git] / CRM / Member / DAO / MembershipStatus.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
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. |
13| |
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. |
18| |
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+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:386d3a47b6acc84c75655d3682cc1403)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_membership_status';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 * Membership Id
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Name for Membership Status
59 *
60 * @var string
61 */
62 public $name;
63 /**
64 * Label for Membership Status
65 *
66 * @var string
67 */
68 public $label;
69 /**
70 * Event when this status starts.
71 *
72 * @var string
73 */
74 public $start_event;
75 /**
76 * Unit used for adjusting from start_event.
77 *
78 * @var string
79 */
80 public $start_event_adjust_unit;
81 /**
82 * Status range begins this many units from start_event.
83 *
84 * @var int
85 */
86 public $start_event_adjust_interval;
87 /**
88 * Event after which this status ends.
89 *
90 * @var string
91 */
92 public $end_event;
93 /**
94 * Unit used for adjusting from the ending event.
95 *
96 * @var string
97 */
98 public $end_event_adjust_unit;
99 /**
100 * Status range ends this many units from end_event.
101 *
102 * @var int
103 */
104 public $end_event_adjust_interval;
105 /**
106 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
107 *
108 * @var boolean
109 */
110 public $is_current_member;
111 /**
112 * Is this status for admin/manual assignment only.
113 *
114 * @var boolean
115 */
116 public $is_admin;
117 /**
118 *
119 * @var int
120 */
121 public $weight;
122 /**
123 * Assign this status to a membership record if no other status match is found.
124 *
125 * @var boolean
126 */
127 public $is_default;
128 /**
129 * Is this membership_status enabled.
130 *
131 * @var boolean
132 */
133 public $is_active;
134 /**
135 * Is this membership_status reserved.
136 *
137 * @var boolean
138 */
139 public $is_reserved;
140 /**
141 * class constructor
142 *
143 * @return civicrm_membership_status
144 */
145 function __construct() {
146 $this->__table = 'civicrm_membership_status';
147 parent::__construct();
148 }
149 /**
150 * Returns all the column names of this table
151 *
152 * @return array
153 */
154 static function &fields() {
346aaaba
TO
155 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
156 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
157 'id' => array(
158 'name' => 'id',
159 'type' => CRM_Utils_Type::T_INT,
160 'title' => ts('Membership Status ID') ,
161 'description' => 'Membership Id',
162 'required' => true,
163 ) ,
164 'membership_status' => array(
165 'name' => 'name',
166 'type' => CRM_Utils_Type::T_STRING,
167 'title' => ts('Membership Status') ,
168 'description' => 'Name for Membership Status',
169 'maxlength' => 128,
170 'size' => CRM_Utils_Type::HUGE,
171 'import' => true,
172 'where' => 'civicrm_membership_status.name',
173 'headerPattern' => '',
174 'dataPattern' => '',
175 'export' => true,
176 ) ,
177 'label' => array(
178 'name' => 'label',
179 'type' => CRM_Utils_Type::T_STRING,
180 'title' => ts('Label') ,
181 'description' => 'Label for Membership Status',
182 'maxlength' => 128,
183 'size' => CRM_Utils_Type::HUGE,
184 ) ,
185 'start_event' => array(
186 'name' => 'start_event',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('Start Event') ,
189 'description' => 'Event when this status starts.',
190 'maxlength' => 12,
191 'size' => CRM_Utils_Type::TWELVE,
192 'html' => array(
193 'type' => 'Select',
194 ) ,
195 'pseudoconstant' => array(
196 'callback' => 'CRM_Core_SelectValues::eventDate',
197 )
198 ) ,
199 'start_event_adjust_unit' => array(
200 'name' => 'start_event_adjust_unit',
201 'type' => CRM_Utils_Type::T_STRING,
202 'title' => ts('Start Event Adjust Unit') ,
203 'description' => 'Unit used for adjusting from start_event.',
204 'maxlength' => 8,
205 'size' => CRM_Utils_Type::EIGHT,
206 'html' => array(
207 'type' => 'Select',
208 ) ,
209 'pseudoconstant' => array(
210 'callback' => 'CRM_Core_SelectValues::unitList',
211 )
212 ) ,
213 'start_event_adjust_interval' => array(
214 'name' => 'start_event_adjust_interval',
215 'type' => CRM_Utils_Type::T_INT,
216 'title' => ts('Start Event Adjust Interval') ,
217 'description' => 'Status range begins this many units from start_event.',
218 ) ,
219 'end_event' => array(
220 'name' => 'end_event',
221 'type' => CRM_Utils_Type::T_STRING,
222 'title' => ts('End Event') ,
223 'description' => 'Event after which this status ends.',
224 'maxlength' => 12,
225 'size' => CRM_Utils_Type::TWELVE,
226 'html' => array(
227 'type' => 'Select',
228 ) ,
229 'pseudoconstant' => array(
230 'callback' => 'CRM_Core_SelectValues::eventDate',
231 )
232 ) ,
233 'end_event_adjust_unit' => array(
234 'name' => 'end_event_adjust_unit',
235 'type' => CRM_Utils_Type::T_STRING,
236 'title' => ts('End Event Adjust Unit') ,
237 'description' => 'Unit used for adjusting from the ending event.',
238 'maxlength' => 8,
239 'size' => CRM_Utils_Type::EIGHT,
240 'html' => array(
241 'type' => 'Select',
242 ) ,
243 'pseudoconstant' => array(
244 'callback' => 'CRM_Core_SelectValues::unitList',
245 )
246 ) ,
247 'end_event_adjust_interval' => array(
248 'name' => 'end_event_adjust_interval',
249 'type' => CRM_Utils_Type::T_INT,
250 'title' => ts('End Event Adjust Interval') ,
251 'description' => 'Status range ends this many units from end_event.',
252 ) ,
253 'is_current_member' => array(
254 'name' => 'is_current_member',
255 'type' => CRM_Utils_Type::T_BOOLEAN,
256 'title' => ts('Current Membership?') ,
257 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
258 ) ,
259 'is_admin' => array(
260 'name' => 'is_admin',
261 'type' => CRM_Utils_Type::T_BOOLEAN,
262 'title' => ts('Admin Assigned Only?') ,
263 'description' => 'Is this status for admin/manual assignment only.',
264 ) ,
265 'weight' => array(
266 'name' => 'weight',
267 'type' => CRM_Utils_Type::T_INT,
268 'title' => ts('Order') ,
269 ) ,
270 'is_default' => array(
271 'name' => 'is_default',
272 'type' => CRM_Utils_Type::T_BOOLEAN,
273 'title' => ts('Default Status?') ,
274 'description' => 'Assign this status to a membership record if no other status match is found.',
275 ) ,
276 'is_active' => array(
277 'name' => 'is_active',
278 'type' => CRM_Utils_Type::T_BOOLEAN,
279 'title' => ts('Is Active') ,
280 'description' => 'Is this membership_status enabled.',
281 'default' => '1',
282 ) ,
283 'is_reserved' => array(
284 'name' => 'is_reserved',
285 'type' => CRM_Utils_Type::T_BOOLEAN,
286 'title' => ts('Is Reserved') ,
287 'description' => 'Is this membership_status reserved.',
288 ) ,
289 );
346aaaba 290 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 291 }
346aaaba 292 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
293 }
294 /**
bd8e0b14 295 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
296 *
297 * @return array
bd8e0b14 298 * Array(string $name => string $uniqueName).
e501603b
TO
299 */
300 static function &fieldKeys() {
bd8e0b14
TO
301 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
302 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 303 }
bd8e0b14 304 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
305 }
306 /**
307 * Returns the names of this table
308 *
309 * @return string
310 */
311 static function getTableName() {
312 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
313 }
314 /**
315 * Returns if this table needs to be logged
316 *
317 * @return boolean
318 */
319 function getLog() {
320 return self::$_log;
321 }
322 /**
323 * Returns the list of fields that can be imported
324 *
325 * @param bool $prefix
326 *
327 * @return array
328 */
329 static function &import($prefix = false) {
60808919
TO
330 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_status', $prefix, array());
331 return $r;
e501603b
TO
332 }
333 /**
334 * Returns the list of fields that can be exported
335 *
336 * @param bool $prefix
337 *
338 * @return array
339 */
340 static function &export($prefix = false) {
60808919
TO
341 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_status', $prefix, array());
342 return $r;
e501603b
TO
343 }
344}