Regen DAOs with new import() / export()
[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';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
e501603b
TO
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = true;
69 /**
70 * Membership Id
71 *
72 * @var int unsigned
73 */
74 public $id;
75 /**
76 * Name for Membership Status
77 *
78 * @var string
79 */
80 public $name;
81 /**
82 * Label for Membership Status
83 *
84 * @var string
85 */
86 public $label;
87 /**
88 * Event when this status starts.
89 *
90 * @var string
91 */
92 public $start_event;
93 /**
94 * Unit used for adjusting from start_event.
95 *
96 * @var string
97 */
98 public $start_event_adjust_unit;
99 /**
100 * Status range begins this many units from start_event.
101 *
102 * @var int
103 */
104 public $start_event_adjust_interval;
105 /**
106 * Event after which this status ends.
107 *
108 * @var string
109 */
110 public $end_event;
111 /**
112 * Unit used for adjusting from the ending event.
113 *
114 * @var string
115 */
116 public $end_event_adjust_unit;
117 /**
118 * Status range ends this many units from end_event.
119 *
120 * @var int
121 */
122 public $end_event_adjust_interval;
123 /**
124 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
125 *
126 * @var boolean
127 */
128 public $is_current_member;
129 /**
130 * Is this status for admin/manual assignment only.
131 *
132 * @var boolean
133 */
134 public $is_admin;
135 /**
136 *
137 * @var int
138 */
139 public $weight;
140 /**
141 * Assign this status to a membership record if no other status match is found.
142 *
143 * @var boolean
144 */
145 public $is_default;
146 /**
147 * Is this membership_status enabled.
148 *
149 * @var boolean
150 */
151 public $is_active;
152 /**
153 * Is this membership_status reserved.
154 *
155 * @var boolean
156 */
157 public $is_reserved;
158 /**
159 * class constructor
160 *
161 * @return civicrm_membership_status
162 */
163 function __construct() {
164 $this->__table = 'civicrm_membership_status';
165 parent::__construct();
166 }
167 /**
168 * Returns all the column names of this table
169 *
170 * @return array
171 */
172 static function &fields() {
173 if (!(self::$_fields)) {
174 self::$_fields = array(
175 'id' => array(
176 'name' => 'id',
177 'type' => CRM_Utils_Type::T_INT,
178 'title' => ts('Membership Status ID') ,
179 'description' => 'Membership Id',
180 'required' => true,
181 ) ,
182 'membership_status' => array(
183 'name' => 'name',
184 'type' => CRM_Utils_Type::T_STRING,
185 'title' => ts('Membership Status') ,
186 'description' => 'Name for Membership Status',
187 'maxlength' => 128,
188 'size' => CRM_Utils_Type::HUGE,
189 'import' => true,
190 'where' => 'civicrm_membership_status.name',
191 'headerPattern' => '',
192 'dataPattern' => '',
193 'export' => true,
194 ) ,
195 'label' => array(
196 'name' => 'label',
197 'type' => CRM_Utils_Type::T_STRING,
198 'title' => ts('Label') ,
199 'description' => 'Label for Membership Status',
200 'maxlength' => 128,
201 'size' => CRM_Utils_Type::HUGE,
202 ) ,
203 'start_event' => array(
204 'name' => 'start_event',
205 'type' => CRM_Utils_Type::T_STRING,
206 'title' => ts('Start Event') ,
207 'description' => 'Event when this status starts.',
208 'maxlength' => 12,
209 'size' => CRM_Utils_Type::TWELVE,
210 'html' => array(
211 'type' => 'Select',
212 ) ,
213 'pseudoconstant' => array(
214 'callback' => 'CRM_Core_SelectValues::eventDate',
215 )
216 ) ,
217 'start_event_adjust_unit' => array(
218 'name' => 'start_event_adjust_unit',
219 'type' => CRM_Utils_Type::T_STRING,
220 'title' => ts('Start Event Adjust Unit') ,
221 'description' => 'Unit used for adjusting from start_event.',
222 'maxlength' => 8,
223 'size' => CRM_Utils_Type::EIGHT,
224 'html' => array(
225 'type' => 'Select',
226 ) ,
227 'pseudoconstant' => array(
228 'callback' => 'CRM_Core_SelectValues::unitList',
229 )
230 ) ,
231 'start_event_adjust_interval' => array(
232 'name' => 'start_event_adjust_interval',
233 'type' => CRM_Utils_Type::T_INT,
234 'title' => ts('Start Event Adjust Interval') ,
235 'description' => 'Status range begins this many units from start_event.',
236 ) ,
237 'end_event' => array(
238 'name' => 'end_event',
239 'type' => CRM_Utils_Type::T_STRING,
240 'title' => ts('End Event') ,
241 'description' => 'Event after which this status ends.',
242 'maxlength' => 12,
243 'size' => CRM_Utils_Type::TWELVE,
244 'html' => array(
245 'type' => 'Select',
246 ) ,
247 'pseudoconstant' => array(
248 'callback' => 'CRM_Core_SelectValues::eventDate',
249 )
250 ) ,
251 'end_event_adjust_unit' => array(
252 'name' => 'end_event_adjust_unit',
253 'type' => CRM_Utils_Type::T_STRING,
254 'title' => ts('End Event Adjust Unit') ,
255 'description' => 'Unit used for adjusting from the ending event.',
256 'maxlength' => 8,
257 'size' => CRM_Utils_Type::EIGHT,
258 'html' => array(
259 'type' => 'Select',
260 ) ,
261 'pseudoconstant' => array(
262 'callback' => 'CRM_Core_SelectValues::unitList',
263 )
264 ) ,
265 'end_event_adjust_interval' => array(
266 'name' => 'end_event_adjust_interval',
267 'type' => CRM_Utils_Type::T_INT,
268 'title' => ts('End Event Adjust Interval') ,
269 'description' => 'Status range ends this many units from end_event.',
270 ) ,
271 'is_current_member' => array(
272 'name' => 'is_current_member',
273 'type' => CRM_Utils_Type::T_BOOLEAN,
274 'title' => ts('Current Membership?') ,
275 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
276 ) ,
277 'is_admin' => array(
278 'name' => 'is_admin',
279 'type' => CRM_Utils_Type::T_BOOLEAN,
280 'title' => ts('Admin Assigned Only?') ,
281 'description' => 'Is this status for admin/manual assignment only.',
282 ) ,
283 'weight' => array(
284 'name' => 'weight',
285 'type' => CRM_Utils_Type::T_INT,
286 'title' => ts('Order') ,
287 ) ,
288 'is_default' => array(
289 'name' => 'is_default',
290 'type' => CRM_Utils_Type::T_BOOLEAN,
291 'title' => ts('Default Status?') ,
292 'description' => 'Assign this status to a membership record if no other status match is found.',
293 ) ,
294 'is_active' => array(
295 'name' => 'is_active',
296 'type' => CRM_Utils_Type::T_BOOLEAN,
297 'title' => ts('Is Active') ,
298 'description' => 'Is this membership_status enabled.',
299 'default' => '1',
300 ) ,
301 'is_reserved' => array(
302 'name' => 'is_reserved',
303 'type' => CRM_Utils_Type::T_BOOLEAN,
304 'title' => ts('Is Reserved') ,
305 'description' => 'Is this membership_status reserved.',
306 ) ,
307 );
308 }
309 return self::$_fields;
310 }
311 /**
312 * Returns an array containing, for each field, the arary key used for that
313 * field in self::$_fields.
314 *
315 * @return array
316 */
317 static function &fieldKeys() {
318 if (!(self::$_fieldKeys)) {
319 self::$_fieldKeys = array(
320 'id' => 'id',
321 'name' => 'membership_status',
322 'label' => 'label',
323 'start_event' => 'start_event',
324 'start_event_adjust_unit' => 'start_event_adjust_unit',
325 'start_event_adjust_interval' => 'start_event_adjust_interval',
326 'end_event' => 'end_event',
327 'end_event_adjust_unit' => 'end_event_adjust_unit',
328 'end_event_adjust_interval' => 'end_event_adjust_interval',
329 'is_current_member' => 'is_current_member',
330 'is_admin' => 'is_admin',
331 'weight' => 'weight',
332 'is_default' => 'is_default',
333 'is_active' => 'is_active',
334 'is_reserved' => 'is_reserved',
335 );
336 }
337 return self::$_fieldKeys;
338 }
339 /**
340 * Returns the names of this table
341 *
342 * @return string
343 */
344 static function getTableName() {
345 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
346 }
347 /**
348 * Returns if this table needs to be logged
349 *
350 * @return boolean
351 */
352 function getLog() {
353 return self::$_log;
354 }
355 /**
356 * Returns the list of fields that can be imported
357 *
358 * @param bool $prefix
359 *
360 * @return array
361 */
362 static function &import($prefix = false) {
60808919
TO
363 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_status', $prefix, array());
364 return $r;
e501603b
TO
365 }
366 /**
367 * Returns the list of fields that can be exported
368 *
369 * @param bool $prefix
370 *
371 * @return array
372 */
373 static function &export($prefix = false) {
60808919
TO
374 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_status', $prefix, array());
375 return $r;
e501603b
TO
376 }
377}