CRM-21050, fixed code to set receive date with correct timestamp
[civicrm-core.git] / CRM / Member / DAO / MembershipStatus.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2017
6 *
7 * Generated from xml/schema/CRM/Member/MembershipStatus.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:dfe977e53a6b66703ab4eca3560048e6)
10 */
11
12 /**
13 * Database access object for the MembershipStatus entity.
14 */
15 class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_membership_status';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = TRUE;
30
31 /**
32 * Membership Id
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Name for Membership Status
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Label for Membership Status
47 *
48 * @var string
49 */
50 public $label;
51
52 /**
53 * Event when this status starts.
54 *
55 * @var string
56 */
57 public $start_event;
58
59 /**
60 * Unit used for adjusting from start_event.
61 *
62 * @var string
63 */
64 public $start_event_adjust_unit;
65
66 /**
67 * Status range begins this many units from start_event.
68 *
69 * @var int
70 */
71 public $start_event_adjust_interval;
72
73 /**
74 * Event after which this status ends.
75 *
76 * @var string
77 */
78 public $end_event;
79
80 /**
81 * Unit used for adjusting from the ending event.
82 *
83 * @var string
84 */
85 public $end_event_adjust_unit;
86
87 /**
88 * Status range ends this many units from end_event.
89 *
90 * @var int
91 */
92 public $end_event_adjust_interval;
93
94 /**
95 * Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).
96 *
97 * @var boolean
98 */
99 public $is_current_member;
100
101 /**
102 * Is this status for admin/manual assignment only.
103 *
104 * @var boolean
105 */
106 public $is_admin;
107
108 /**
109 * @var int
110 */
111 public $weight;
112
113 /**
114 * Assign this status to a membership record if no other status match is found.
115 *
116 * @var boolean
117 */
118 public $is_default;
119
120 /**
121 * Is this membership_status enabled.
122 *
123 * @var boolean
124 */
125 public $is_active;
126
127 /**
128 * Is this membership_status reserved.
129 *
130 * @var boolean
131 */
132 public $is_reserved;
133
134 /**
135 * Class constructor.
136 */
137 public function __construct() {
138 $this->__table = 'civicrm_membership_status';
139 parent::__construct();
140 }
141
142 /**
143 * Returns all the column names of this table
144 *
145 * @return array
146 */
147 public static function &fields() {
148 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
149 Civi::$statics[__CLASS__]['fields'] = [
150 'id' => [
151 'name' => 'id',
152 'type' => CRM_Utils_Type::T_INT,
153 'title' => ts('Membership Status ID'),
154 'description' => 'Membership Id',
155 'required' => TRUE,
156 'table_name' => 'civicrm_membership_status',
157 'entity' => 'MembershipStatus',
158 'bao' => 'CRM_Member_BAO_MembershipStatus',
159 'localizable' => 0,
160 ],
161 'membership_status' => [
162 'name' => 'name',
163 'type' => CRM_Utils_Type::T_STRING,
164 'title' => ts('Membership Status'),
165 'description' => 'Name for Membership Status',
166 'maxlength' => 128,
167 'size' => CRM_Utils_Type::HUGE,
168 'import' => TRUE,
169 'where' => 'civicrm_membership_status.name',
170 'headerPattern' => '',
171 'dataPattern' => '',
172 'export' => TRUE,
173 'table_name' => 'civicrm_membership_status',
174 'entity' => 'MembershipStatus',
175 'bao' => 'CRM_Member_BAO_MembershipStatus',
176 'localizable' => 0,
177 ],
178 'label' => [
179 'name' => 'label',
180 'type' => CRM_Utils_Type::T_STRING,
181 'title' => ts('Label'),
182 'description' => 'Label for Membership Status',
183 'maxlength' => 128,
184 'size' => CRM_Utils_Type::HUGE,
185 'table_name' => 'civicrm_membership_status',
186 'entity' => 'MembershipStatus',
187 'bao' => 'CRM_Member_BAO_MembershipStatus',
188 'localizable' => 1,
189 ],
190 'start_event' => [
191 'name' => 'start_event',
192 'type' => CRM_Utils_Type::T_STRING,
193 'title' => ts('Start Event'),
194 'description' => 'Event when this status starts.',
195 'maxlength' => 12,
196 'size' => CRM_Utils_Type::TWELVE,
197 'table_name' => 'civicrm_membership_status',
198 'entity' => 'MembershipStatus',
199 'bao' => 'CRM_Member_BAO_MembershipStatus',
200 'localizable' => 0,
201 'html' => [
202 'type' => 'Select',
203 ],
204 'pseudoconstant' => [
205 'callback' => 'CRM_Core_SelectValues::eventDate',
206 ]
207 ],
208 'start_event_adjust_unit' => [
209 'name' => 'start_event_adjust_unit',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Start Event Adjust Unit'),
212 'description' => 'Unit used for adjusting from start_event.',
213 'maxlength' => 8,
214 'size' => CRM_Utils_Type::EIGHT,
215 'table_name' => 'civicrm_membership_status',
216 'entity' => 'MembershipStatus',
217 'bao' => 'CRM_Member_BAO_MembershipStatus',
218 'localizable' => 0,
219 'html' => [
220 'type' => 'Select',
221 ],
222 'pseudoconstant' => [
223 'callback' => 'CRM_Core_SelectValues::unitList',
224 ]
225 ],
226 'start_event_adjust_interval' => [
227 'name' => 'start_event_adjust_interval',
228 'type' => CRM_Utils_Type::T_INT,
229 'title' => ts('Start Event Adjust Interval'),
230 'description' => 'Status range begins this many units from start_event.',
231 'table_name' => 'civicrm_membership_status',
232 'entity' => 'MembershipStatus',
233 'bao' => 'CRM_Member_BAO_MembershipStatus',
234 'localizable' => 0,
235 ],
236 'end_event' => [
237 'name' => 'end_event',
238 'type' => CRM_Utils_Type::T_STRING,
239 'title' => ts('End Event'),
240 'description' => 'Event after which this status ends.',
241 'maxlength' => 12,
242 'size' => CRM_Utils_Type::TWELVE,
243 'table_name' => 'civicrm_membership_status',
244 'entity' => 'MembershipStatus',
245 'bao' => 'CRM_Member_BAO_MembershipStatus',
246 'localizable' => 0,
247 'html' => [
248 'type' => 'Select',
249 ],
250 'pseudoconstant' => [
251 'callback' => 'CRM_Core_SelectValues::eventDate',
252 ]
253 ],
254 'end_event_adjust_unit' => [
255 'name' => 'end_event_adjust_unit',
256 'type' => CRM_Utils_Type::T_STRING,
257 'title' => ts('End Event Adjust Unit'),
258 'description' => 'Unit used for adjusting from the ending event.',
259 'maxlength' => 8,
260 'size' => CRM_Utils_Type::EIGHT,
261 'table_name' => 'civicrm_membership_status',
262 'entity' => 'MembershipStatus',
263 'bao' => 'CRM_Member_BAO_MembershipStatus',
264 'localizable' => 0,
265 'html' => [
266 'type' => 'Select',
267 ],
268 'pseudoconstant' => [
269 'callback' => 'CRM_Core_SelectValues::unitList',
270 ]
271 ],
272 'end_event_adjust_interval' => [
273 'name' => 'end_event_adjust_interval',
274 'type' => CRM_Utils_Type::T_INT,
275 'title' => ts('End Event Adjust Interval'),
276 'description' => 'Status range ends this many units from end_event.',
277 'table_name' => 'civicrm_membership_status',
278 'entity' => 'MembershipStatus',
279 'bao' => 'CRM_Member_BAO_MembershipStatus',
280 'localizable' => 0,
281 ],
282 'is_current_member' => [
283 'name' => 'is_current_member',
284 'type' => CRM_Utils_Type::T_BOOLEAN,
285 'title' => ts('Current Membership?'),
286 'description' => 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
287 'table_name' => 'civicrm_membership_status',
288 'entity' => 'MembershipStatus',
289 'bao' => 'CRM_Member_BAO_MembershipStatus',
290 'localizable' => 0,
291 ],
292 'is_admin' => [
293 'name' => 'is_admin',
294 'type' => CRM_Utils_Type::T_BOOLEAN,
295 'title' => ts('Admin Assigned Only?'),
296 'description' => 'Is this status for admin/manual assignment only.',
297 'table_name' => 'civicrm_membership_status',
298 'entity' => 'MembershipStatus',
299 'bao' => 'CRM_Member_BAO_MembershipStatus',
300 'localizable' => 0,
301 ],
302 'weight' => [
303 'name' => 'weight',
304 'type' => CRM_Utils_Type::T_INT,
305 'title' => ts('Order'),
306 'table_name' => 'civicrm_membership_status',
307 'entity' => 'MembershipStatus',
308 'bao' => 'CRM_Member_BAO_MembershipStatus',
309 'localizable' => 0,
310 ],
311 'is_default' => [
312 'name' => 'is_default',
313 'type' => CRM_Utils_Type::T_BOOLEAN,
314 'title' => ts('Default Status?'),
315 'description' => 'Assign this status to a membership record if no other status match is found.',
316 'table_name' => 'civicrm_membership_status',
317 'entity' => 'MembershipStatus',
318 'bao' => 'CRM_Member_BAO_MembershipStatus',
319 'localizable' => 0,
320 ],
321 'is_active' => [
322 'name' => 'is_active',
323 'type' => CRM_Utils_Type::T_BOOLEAN,
324 'title' => ts('Is Active'),
325 'description' => 'Is this membership_status enabled.',
326 'default' => '1',
327 'table_name' => 'civicrm_membership_status',
328 'entity' => 'MembershipStatus',
329 'bao' => 'CRM_Member_BAO_MembershipStatus',
330 'localizable' => 0,
331 ],
332 'is_reserved' => [
333 'name' => 'is_reserved',
334 'type' => CRM_Utils_Type::T_BOOLEAN,
335 'title' => ts('Is Reserved'),
336 'description' => 'Is this membership_status reserved.',
337 'table_name' => 'civicrm_membership_status',
338 'entity' => 'MembershipStatus',
339 'bao' => 'CRM_Member_BAO_MembershipStatus',
340 'localizable' => 0,
341 ],
342 ];
343 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
344 }
345 return Civi::$statics[__CLASS__]['fields'];
346 }
347
348 /**
349 * Return a mapping from field-name to the corresponding key (as used in fields()).
350 *
351 * @return array
352 * Array(string $name => string $uniqueName).
353 */
354 public static function &fieldKeys() {
355 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
356 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
357 }
358 return Civi::$statics[__CLASS__]['fieldKeys'];
359 }
360
361 /**
362 * Returns the names of this table
363 *
364 * @return string
365 */
366 public static function getTableName() {
367 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
368 }
369
370 /**
371 * Returns if this table needs to be logged
372 *
373 * @return bool
374 */
375 public function getLog() {
376 return self::$_log;
377 }
378
379 /**
380 * Returns the list of fields that can be imported
381 *
382 * @param bool $prefix
383 *
384 * @return array
385 */
386 public static function &import($prefix = FALSE) {
387 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_status', $prefix, []);
388 return $r;
389 }
390
391 /**
392 * Returns the list of fields that can be exported
393 *
394 * @param bool $prefix
395 *
396 * @return array
397 */
398 public static function &export($prefix = FALSE) {
399 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_status', $prefix, []);
400 return $r;
401 }
402
403 /**
404 * Returns the list of indices
405 *
406 * @param bool $localize
407 *
408 * @return array
409 */
410 public static function indices($localize = TRUE) {
411 $indices = [];
412 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
413 }
414
415 }