Merge pull request #9651 from fuzionnz/CRM-19844-hook_only_when_success
[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
437fafcf 33 * (GenCodeChecksum:386d3a47b6acc84c75655d3682cc1403)
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,
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}