CRM-20312 regenerated DAOS with indexes
[civicrm-core.git] / CRM / Member / DAO / MembershipStatus.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
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
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
6a7e5e5d 33 * (GenCodeChecksum:dfe977e53a6b66703ab4eca3560048e6)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Member_DAO_MembershipStatus constructor.
39 */
e501603b
TO
40class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_membership_status';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Membership Id
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Name for Membership Status
61 *
62 * @var string
63 */
64 public $name;
65 /**
66 * Label for Membership Status
67 *
68 * @var string
69 */
70 public $label;
71 /**
72 * Event when this status starts.
73 *
74 * @var string
75 */
76 public $start_event;
77 /**
78 * Unit used for adjusting from start_event.
79 *
80 * @var string
81 */
82 public $start_event_adjust_unit;
83 /**
84 * Status range begins this many units from start_event.
85 *
86 * @var int
87 */
88 public $start_event_adjust_interval;
89 /**
90 * Event after which this status ends.
91 *
92 * @var string
93 */
94 public $end_event;
95 /**
96 * Unit used for adjusting from the ending event.
97 *
98 * @var string
99 */
100 public $end_event_adjust_unit;
101 /**
102 * Status range ends this many units from end_event.
103 *
104 * @var int
105 */
106 public $end_event_adjust_interval;
107 /**
108 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
109 *
110 * @var boolean
111 */
112 public $is_current_member;
113 /**
114 * Is this status for admin/manual assignment only.
115 *
116 * @var boolean
117 */
118 public $is_admin;
119 /**
120 *
121 * @var int
122 */
123 public $weight;
124 /**
125 * Assign this status to a membership record if no other status match is found.
126 *
127 * @var boolean
128 */
129 public $is_default;
130 /**
131 * Is this membership_status enabled.
132 *
133 * @var boolean
134 */
135 public $is_active;
136 /**
137 * Is this membership_status reserved.
138 *
139 * @var boolean
140 */
141 public $is_reserved;
142 /**
f41f0342 143 * Class constructor.
e501603b
TO
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,
522a26c9 163 'table_name' => 'civicrm_membership_status',
164 'entity' => 'MembershipStatus',
165 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 166 'localizable' => 0,
e501603b
TO
167 ) ,
168 'membership_status' => array(
169 'name' => 'name',
170 'type' => CRM_Utils_Type::T_STRING,
171 'title' => ts('Membership Status') ,
172 'description' => 'Name for Membership Status',
173 'maxlength' => 128,
174 'size' => CRM_Utils_Type::HUGE,
175 'import' => true,
176 'where' => 'civicrm_membership_status.name',
177 'headerPattern' => '',
178 'dataPattern' => '',
179 'export' => true,
522a26c9 180 'table_name' => 'civicrm_membership_status',
181 'entity' => 'MembershipStatus',
182 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 183 'localizable' => 0,
e501603b
TO
184 ) ,
185 'label' => array(
186 'name' => 'label',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('Label') ,
189 'description' => 'Label for Membership Status',
190 'maxlength' => 128,
191 'size' => CRM_Utils_Type::HUGE,
522a26c9 192 'table_name' => 'civicrm_membership_status',
193 'entity' => 'MembershipStatus',
194 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 195 'localizable' => 1,
e501603b
TO
196 ) ,
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.',
202 'maxlength' => 12,
203 'size' => CRM_Utils_Type::TWELVE,
522a26c9 204 'table_name' => 'civicrm_membership_status',
205 'entity' => 'MembershipStatus',
206 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 207 'localizable' => 0,
e501603b
TO
208 'html' => array(
209 'type' => 'Select',
210 ) ,
211 'pseudoconstant' => array(
212 'callback' => 'CRM_Core_SelectValues::eventDate',
213 )
214 ) ,
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.',
220 'maxlength' => 8,
221 'size' => CRM_Utils_Type::EIGHT,
522a26c9 222 'table_name' => 'civicrm_membership_status',
223 'entity' => 'MembershipStatus',
224 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 225 'localizable' => 0,
e501603b
TO
226 'html' => array(
227 'type' => 'Select',
228 ) ,
229 'pseudoconstant' => array(
230 'callback' => 'CRM_Core_SelectValues::unitList',
231 )
232 ) ,
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.',
522a26c9 238 'table_name' => 'civicrm_membership_status',
239 'entity' => 'MembershipStatus',
240 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 241 'localizable' => 0,
e501603b
TO
242 ) ,
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.',
248 'maxlength' => 12,
249 'size' => CRM_Utils_Type::TWELVE,
522a26c9 250 'table_name' => 'civicrm_membership_status',
251 'entity' => 'MembershipStatus',
252 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 253 'localizable' => 0,
e501603b
TO
254 'html' => array(
255 'type' => 'Select',
256 ) ,
257 'pseudoconstant' => array(
258 'callback' => 'CRM_Core_SelectValues::eventDate',
259 )
260 ) ,
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.',
266 'maxlength' => 8,
267 'size' => CRM_Utils_Type::EIGHT,
522a26c9 268 'table_name' => 'civicrm_membership_status',
269 'entity' => 'MembershipStatus',
270 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 271 'localizable' => 0,
e501603b
TO
272 'html' => array(
273 'type' => 'Select',
274 ) ,
275 'pseudoconstant' => array(
276 'callback' => 'CRM_Core_SelectValues::unitList',
277 )
278 ) ,
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.',
522a26c9 284 'table_name' => 'civicrm_membership_status',
285 'entity' => 'MembershipStatus',
286 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 287 'localizable' => 0,
e501603b
TO
288 ) ,
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).',
522a26c9 294 'table_name' => 'civicrm_membership_status',
295 'entity' => 'MembershipStatus',
296 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 297 'localizable' => 0,
e501603b
TO
298 ) ,
299 'is_admin' => array(
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.',
522a26c9 304 'table_name' => 'civicrm_membership_status',
305 'entity' => 'MembershipStatus',
306 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 307 'localizable' => 0,
e501603b
TO
308 ) ,
309 'weight' => array(
310 'name' => 'weight',
311 'type' => CRM_Utils_Type::T_INT,
312 'title' => ts('Order') ,
522a26c9 313 'table_name' => 'civicrm_membership_status',
314 'entity' => 'MembershipStatus',
315 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 316 'localizable' => 0,
e501603b
TO
317 ) ,
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.',
522a26c9 323 'table_name' => 'civicrm_membership_status',
324 'entity' => 'MembershipStatus',
325 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 326 'localizable' => 0,
e501603b
TO
327 ) ,
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.',
333 'default' => '1',
522a26c9 334 'table_name' => 'civicrm_membership_status',
335 'entity' => 'MembershipStatus',
336 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 337 'localizable' => 0,
e501603b
TO
338 ) ,
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.',
522a26c9 344 'table_name' => 'civicrm_membership_status',
345 'entity' => 'MembershipStatus',
346 'bao' => 'CRM_Member_BAO_MembershipStatus',
6a7e5e5d 347 'localizable' => 0,
e501603b
TO
348 ) ,
349 );
346aaaba 350 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 351 }
346aaaba 352 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
353 }
354 /**
bd8e0b14 355 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
356 *
357 * @return array
bd8e0b14 358 * Array(string $name => string $uniqueName).
e501603b
TO
359 */
360 static function &fieldKeys() {
bd8e0b14
TO
361 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
362 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 363 }
bd8e0b14 364 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
365 }
366 /**
367 * Returns the names of this table
368 *
369 * @return string
370 */
371 static function getTableName() {
372 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
373 }
374 /**
375 * Returns if this table needs to be logged
376 *
377 * @return boolean
378 */
379 function getLog() {
380 return self::$_log;
381 }
382 /**
383 * Returns the list of fields that can be imported
384 *
385 * @param bool $prefix
386 *
387 * @return array
388 */
389 static function &import($prefix = false) {
60808919
TO
390 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_status', $prefix, array());
391 return $r;
e501603b
TO
392 }
393 /**
394 * Returns the list of fields that can be exported
395 *
396 * @param bool $prefix
397 *
398 * @return array
399 */
400 static function &export($prefix = false) {
60808919
TO
401 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_status', $prefix, array());
402 return $r;
e501603b 403 }
e7a6b91a
AS
404 /**
405 * Returns the list of indices
406 */
407 public static function indices($localize = TRUE) {
408 $indices = array();
409 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
410 }
e501603b 411}