CRM-20343: skip status calculation when form dates are not modified.
[civicrm-core.git] / CRM / Member / DAO / MembershipBlock.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/MembershipBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
022785d8 33 * (GenCodeChecksum:7d3680991e8df4820b93c443def8d5d0)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Member_DAO_MembershipBlock constructor.
39 */
e501603b
TO
40class CRM_Member_DAO_MembershipBlock 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_block';
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 $entity_table;
65 /**
66 * FK to civicrm_contribution_page.id
67 *
68 * @var int unsigned
69 */
70 public $entity_id;
71 /**
72 * Membership types to be exposed by this block
73 *
74 * @var string
75 */
76 public $membership_types;
77 /**
78 * Optional foreign key to membership_type
79 *
80 * @var int unsigned
81 */
82 public $membership_type_default;
83 /**
84 * Display minimum membership fee
85 *
86 * @var boolean
87 */
88 public $display_min_fee;
89 /**
90 * Should membership transactions be processed separately
91 *
92 * @var boolean
93 */
94 public $is_separate_payment;
95 /**
96 * Title to display at top of block
97 *
98 * @var string
99 */
100 public $new_title;
101 /**
102 * Text to display below title
103 *
104 * @var text
105 */
106 public $new_text;
107 /**
108 * Title for renewal
109 *
110 * @var string
111 */
112 public $renewal_title;
113 /**
114 * Text to display for member renewal
115 *
116 * @var text
117 */
118 public $renewal_text;
119 /**
120 * Is membership sign up optional
121 *
122 * @var boolean
123 */
124 public $is_required;
125 /**
126 * Is this membership_block enabled
127 *
128 * @var boolean
129 */
130 public $is_active;
131 /**
f41f0342 132 * Class constructor.
e501603b
TO
133 */
134 function __construct() {
135 $this->__table = 'civicrm_membership_block';
136 parent::__construct();
137 }
138 /**
f41f0342 139 * Returns foreign keys and entity references.
e501603b
TO
140 *
141 * @return array
142 * [CRM_Core_Reference_Interface]
143 */
144 static function getReferenceColumns() {
346aaaba
TO
145 if (!isset(Civi::$statics[__CLASS__]['links'])) {
146 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
147 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'entity_id', 'civicrm_contribution_page', 'id');
148 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_default', 'civicrm_membership_type', 'id');
149 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 150 }
346aaaba 151 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
152 }
153 /**
154 * Returns all the column names of this table
155 *
156 * @return array
157 */
158 static function &fields() {
346aaaba
TO
159 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
160 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
161 'id' => array(
162 'name' => 'id',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Membership Block ID') ,
165 'description' => 'Membership Id',
166 'required' => true,
522a26c9 167 'table_name' => 'civicrm_membership_block',
168 'entity' => 'MembershipBlock',
169 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
170 ) ,
171 'entity_table' => array(
172 'name' => 'entity_table',
173 'type' => CRM_Utils_Type::T_STRING,
174 'title' => ts('Membership Block Entity Table') ,
175 'description' => 'Name for Membership Status',
176 'maxlength' => 64,
177 'size' => CRM_Utils_Type::BIG,
522a26c9 178 'table_name' => 'civicrm_membership_block',
179 'entity' => 'MembershipBlock',
180 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
181 ) ,
182 'entity_id' => array(
183 'name' => 'entity_id',
184 'type' => CRM_Utils_Type::T_INT,
185 'title' => ts('Membership Block Entity ID') ,
186 'description' => 'FK to civicrm_contribution_page.id',
187 'required' => true,
522a26c9 188 'table_name' => 'civicrm_membership_block',
189 'entity' => 'MembershipBlock',
190 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
191 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
192 ) ,
193 'membership_types' => array(
194 'name' => 'membership_types',
195 'type' => CRM_Utils_Type::T_STRING,
196 'title' => ts('Membership Block Membership Types') ,
197 'description' => 'Membership types to be exposed by this block',
198 'maxlength' => 1024,
199 'size' => CRM_Utils_Type::HUGE,
522a26c9 200 'table_name' => 'civicrm_membership_block',
201 'entity' => 'MembershipBlock',
202 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
203 ) ,
204 'membership_type_default' => array(
205 'name' => 'membership_type_default',
206 'type' => CRM_Utils_Type::T_INT,
207 'title' => ts('Membership Block Default Type') ,
208 'description' => 'Optional foreign key to membership_type',
522a26c9 209 'table_name' => 'civicrm_membership_block',
210 'entity' => 'MembershipBlock',
211 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
212 'FKClassName' => 'CRM_Member_DAO_MembershipType',
213 ) ,
214 'display_min_fee' => array(
215 'name' => 'display_min_fee',
216 'type' => CRM_Utils_Type::T_BOOLEAN,
217 'title' => ts('Membership Block Display Minimum Fee') ,
218 'description' => 'Display minimum membership fee',
219 'default' => '1',
522a26c9 220 'table_name' => 'civicrm_membership_block',
221 'entity' => 'MembershipBlock',
222 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
223 ) ,
224 'is_separate_payment' => array(
225 'name' => 'is_separate_payment',
226 'type' => CRM_Utils_Type::T_BOOLEAN,
227 'title' => ts('Membership Block Is Separate Payment') ,
228 'description' => 'Should membership transactions be processed separately',
229 'default' => '1',
522a26c9 230 'table_name' => 'civicrm_membership_block',
231 'entity' => 'MembershipBlock',
232 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
233 ) ,
234 'new_title' => array(
235 'name' => 'new_title',
236 'type' => CRM_Utils_Type::T_STRING,
237 'title' => ts('Membership Block New Title') ,
238 'description' => 'Title to display at top of block',
239 'maxlength' => 255,
240 'size' => CRM_Utils_Type::HUGE,
522a26c9 241 'table_name' => 'civicrm_membership_block',
242 'entity' => 'MembershipBlock',
243 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
244 ) ,
245 'new_text' => array(
246 'name' => 'new_text',
247 'type' => CRM_Utils_Type::T_TEXT,
248 'title' => ts('Membership Block New Text') ,
249 'description' => 'Text to display below title',
522a26c9 250 'table_name' => 'civicrm_membership_block',
251 'entity' => 'MembershipBlock',
252 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
253 ) ,
254 'renewal_title' => array(
255 'name' => 'renewal_title',
256 'type' => CRM_Utils_Type::T_STRING,
257 'title' => ts('Membership Block Renewal Title') ,
258 'description' => 'Title for renewal',
259 'maxlength' => 255,
260 'size' => CRM_Utils_Type::HUGE,
522a26c9 261 'table_name' => 'civicrm_membership_block',
262 'entity' => 'MembershipBlock',
263 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
264 ) ,
265 'renewal_text' => array(
266 'name' => 'renewal_text',
267 'type' => CRM_Utils_Type::T_TEXT,
268 'title' => ts('Membership Block Renewal Text') ,
269 'description' => 'Text to display for member renewal',
522a26c9 270 'table_name' => 'civicrm_membership_block',
271 'entity' => 'MembershipBlock',
272 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
273 ) ,
274 'is_required' => array(
275 'name' => 'is_required',
276 'type' => CRM_Utils_Type::T_BOOLEAN,
277 'title' => ts('Is Required') ,
278 'description' => 'Is membership sign up optional',
522a26c9 279 'table_name' => 'civicrm_membership_block',
280 'entity' => 'MembershipBlock',
281 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
282 ) ,
283 'is_active' => array(
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type::T_BOOLEAN,
286 'title' => ts('Is Active') ,
287 'description' => 'Is this membership_block enabled',
288 'default' => '1',
522a26c9 289 'table_name' => 'civicrm_membership_block',
290 'entity' => 'MembershipBlock',
291 'bao' => 'CRM_Member_BAO_MembershipBlock',
e501603b
TO
292 ) ,
293 );
346aaaba 294 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 295 }
346aaaba 296 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
297 }
298 /**
bd8e0b14 299 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
300 *
301 * @return array
bd8e0b14 302 * Array(string $name => string $uniqueName).
e501603b
TO
303 */
304 static function &fieldKeys() {
bd8e0b14
TO
305 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
306 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 307 }
bd8e0b14 308 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
309 }
310 /**
311 * Returns the names of this table
312 *
313 * @return string
314 */
315 static function getTableName() {
316 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
317 }
318 /**
319 * Returns if this table needs to be logged
320 *
321 * @return boolean
322 */
323 function getLog() {
324 return self::$_log;
325 }
326 /**
327 * Returns the list of fields that can be imported
328 *
329 * @param bool $prefix
330 *
331 * @return array
332 */
333 static function &import($prefix = false) {
60808919
TO
334 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_block', $prefix, array());
335 return $r;
e501603b
TO
336 }
337 /**
338 * Returns the list of fields that can be exported
339 *
340 * @param bool $prefix
341 *
342 * @return array
343 */
344 static function &export($prefix = false) {
60808919
TO
345 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_block', $prefix, array());
346 return $r;
e501603b
TO
347 }
348}