Merge pull request #10450 from JMAConsulting/CRM-20667
[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
6a7e5e5d 33 * (GenCodeChecksum:3ee510fab11783acf6ee994f090436f6)
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',
6a7e5e5d 170 'localizable' => 0,
e501603b
TO
171 ) ,
172 'entity_table' => array(
173 'name' => 'entity_table',
174 'type' => CRM_Utils_Type::T_STRING,
175 'title' => ts('Membership Block Entity Table') ,
176 'description' => 'Name for Membership Status',
177 'maxlength' => 64,
178 'size' => CRM_Utils_Type::BIG,
522a26c9 179 'table_name' => 'civicrm_membership_block',
180 'entity' => 'MembershipBlock',
181 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 182 'localizable' => 0,
e501603b
TO
183 ) ,
184 'entity_id' => array(
185 'name' => 'entity_id',
186 'type' => CRM_Utils_Type::T_INT,
187 'title' => ts('Membership Block Entity ID') ,
188 'description' => 'FK to civicrm_contribution_page.id',
189 'required' => true,
522a26c9 190 'table_name' => 'civicrm_membership_block',
191 'entity' => 'MembershipBlock',
192 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 193 'localizable' => 0,
e501603b
TO
194 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
195 ) ,
196 'membership_types' => array(
197 'name' => 'membership_types',
198 'type' => CRM_Utils_Type::T_STRING,
199 'title' => ts('Membership Block Membership Types') ,
200 'description' => 'Membership types to be exposed by this block',
201 'maxlength' => 1024,
202 'size' => CRM_Utils_Type::HUGE,
522a26c9 203 'table_name' => 'civicrm_membership_block',
204 'entity' => 'MembershipBlock',
205 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 206 'localizable' => 0,
e501603b
TO
207 ) ,
208 'membership_type_default' => array(
209 'name' => 'membership_type_default',
210 'type' => CRM_Utils_Type::T_INT,
211 'title' => ts('Membership Block Default Type') ,
212 'description' => 'Optional foreign key to membership_type',
522a26c9 213 'table_name' => 'civicrm_membership_block',
214 'entity' => 'MembershipBlock',
215 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 216 'localizable' => 0,
e501603b
TO
217 'FKClassName' => 'CRM_Member_DAO_MembershipType',
218 ) ,
219 'display_min_fee' => array(
220 'name' => 'display_min_fee',
221 'type' => CRM_Utils_Type::T_BOOLEAN,
222 'title' => ts('Membership Block Display Minimum Fee') ,
223 'description' => 'Display minimum membership fee',
224 'default' => '1',
522a26c9 225 'table_name' => 'civicrm_membership_block',
226 'entity' => 'MembershipBlock',
227 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 228 'localizable' => 0,
e501603b
TO
229 ) ,
230 'is_separate_payment' => array(
231 'name' => 'is_separate_payment',
232 'type' => CRM_Utils_Type::T_BOOLEAN,
233 'title' => ts('Membership Block Is Separate Payment') ,
234 'description' => 'Should membership transactions be processed separately',
235 'default' => '1',
522a26c9 236 'table_name' => 'civicrm_membership_block',
237 'entity' => 'MembershipBlock',
238 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 239 'localizable' => 0,
e501603b
TO
240 ) ,
241 'new_title' => array(
242 'name' => 'new_title',
243 'type' => CRM_Utils_Type::T_STRING,
244 'title' => ts('Membership Block New Title') ,
245 'description' => 'Title to display at top of block',
246 'maxlength' => 255,
247 'size' => CRM_Utils_Type::HUGE,
522a26c9 248 'table_name' => 'civicrm_membership_block',
249 'entity' => 'MembershipBlock',
250 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 251 'localizable' => 1,
e501603b
TO
252 ) ,
253 'new_text' => array(
254 'name' => 'new_text',
255 'type' => CRM_Utils_Type::T_TEXT,
256 'title' => ts('Membership Block New Text') ,
257 'description' => 'Text to display below title',
522a26c9 258 'table_name' => 'civicrm_membership_block',
259 'entity' => 'MembershipBlock',
260 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 261 'localizable' => 1,
e501603b
TO
262 ) ,
263 'renewal_title' => array(
264 'name' => 'renewal_title',
265 'type' => CRM_Utils_Type::T_STRING,
266 'title' => ts('Membership Block Renewal Title') ,
267 'description' => 'Title for renewal',
268 'maxlength' => 255,
269 'size' => CRM_Utils_Type::HUGE,
522a26c9 270 'table_name' => 'civicrm_membership_block',
271 'entity' => 'MembershipBlock',
272 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 273 'localizable' => 1,
e501603b
TO
274 ) ,
275 'renewal_text' => array(
276 'name' => 'renewal_text',
277 'type' => CRM_Utils_Type::T_TEXT,
278 'title' => ts('Membership Block Renewal Text') ,
279 'description' => 'Text to display for member renewal',
522a26c9 280 'table_name' => 'civicrm_membership_block',
281 'entity' => 'MembershipBlock',
282 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 283 'localizable' => 1,
e501603b
TO
284 ) ,
285 'is_required' => array(
286 'name' => 'is_required',
287 'type' => CRM_Utils_Type::T_BOOLEAN,
288 'title' => ts('Is Required') ,
289 'description' => 'Is membership sign up optional',
522a26c9 290 'table_name' => 'civicrm_membership_block',
291 'entity' => 'MembershipBlock',
292 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 293 'localizable' => 0,
e501603b
TO
294 ) ,
295 'is_active' => array(
296 'name' => 'is_active',
297 'type' => CRM_Utils_Type::T_BOOLEAN,
298 'title' => ts('Is Active') ,
299 'description' => 'Is this membership_block enabled',
300 'default' => '1',
522a26c9 301 'table_name' => 'civicrm_membership_block',
302 'entity' => 'MembershipBlock',
303 'bao' => 'CRM_Member_BAO_MembershipBlock',
6a7e5e5d 304 'localizable' => 0,
e501603b
TO
305 ) ,
306 );
346aaaba 307 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 308 }
346aaaba 309 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
310 }
311 /**
bd8e0b14 312 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
313 *
314 * @return array
bd8e0b14 315 * Array(string $name => string $uniqueName).
e501603b
TO
316 */
317 static function &fieldKeys() {
bd8e0b14
TO
318 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
319 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 320 }
bd8e0b14 321 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
322 }
323 /**
324 * Returns the names of this table
325 *
326 * @return string
327 */
328 static function getTableName() {
329 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
330 }
331 /**
332 * Returns if this table needs to be logged
333 *
334 * @return boolean
335 */
336 function getLog() {
337 return self::$_log;
338 }
339 /**
340 * Returns the list of fields that can be imported
341 *
342 * @param bool $prefix
343 *
344 * @return array
345 */
346 static function &import($prefix = false) {
60808919
TO
347 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_block', $prefix, array());
348 return $r;
e501603b
TO
349 }
350 /**
351 * Returns the list of fields that can be exported
352 *
353 * @param bool $prefix
354 *
355 * @return array
356 */
357 static function &export($prefix = false) {
60808919
TO
358 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_block', $prefix, array());
359 return $r;
e501603b 360 }
e7a6b91a
AS
361 /**
362 * Returns the list of indices
363 */
364 public static function indices($localize = TRUE) {
365 $indices = array();
366 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
367 }
e501603b 368}