Merge pull request #19570 from colemanw/deleteOldXml
[civicrm-core.git] / CRM / Member / DAO / MembershipBlock.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4507d044332c623e6da4979516fef906)
10 */
11
12 /**
13 * Database access object for the MembershipBlock entity.
14 */
15 class CRM_Member_DAO_MembershipBlock extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.5';
18 const COMPONENT = 'CiviMember';
19
20 /**
21 * Static instance to hold the table name.
22 *
23 * @var string
24 */
25 public static $_tableName = 'civicrm_membership_block';
26
27 /**
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 *
30 * @var bool
31 */
32 public static $_log = TRUE;
33
34 /**
35 * Membership ID
36 *
37 * @var int
38 */
39 public $id;
40
41 /**
42 * Name for Membership Status
43 *
44 * @var string
45 */
46 public $entity_table;
47
48 /**
49 * FK to civicrm_contribution_page.id
50 *
51 * @var int
52 */
53 public $entity_id;
54
55 /**
56 * Membership types to be exposed by this block
57 *
58 * @var string
59 */
60 public $membership_types;
61
62 /**
63 * Optional foreign key to membership_type
64 *
65 * @var int
66 */
67 public $membership_type_default;
68
69 /**
70 * Display minimum membership fee
71 *
72 * @var bool
73 */
74 public $display_min_fee;
75
76 /**
77 * Should membership transactions be processed separately
78 *
79 * @var bool
80 */
81 public $is_separate_payment;
82
83 /**
84 * Title to display at top of block
85 *
86 * @var string
87 */
88 public $new_title;
89
90 /**
91 * Text to display below title
92 *
93 * @var text
94 */
95 public $new_text;
96
97 /**
98 * Title for renewal
99 *
100 * @var string
101 */
102 public $renewal_title;
103
104 /**
105 * Text to display for member renewal
106 *
107 * @var text
108 */
109 public $renewal_text;
110
111 /**
112 * Is membership sign up optional
113 *
114 * @var bool
115 */
116 public $is_required;
117
118 /**
119 * Is this membership_block enabled
120 *
121 * @var bool
122 */
123 public $is_active;
124
125 /**
126 * Class constructor.
127 */
128 public function __construct() {
129 $this->__table = 'civicrm_membership_block';
130 parent::__construct();
131 }
132
133 /**
134 * Returns localized title of this entity.
135 *
136 * @param bool $plural
137 * Whether to return the plural version of the title.
138 */
139 public static function getEntityTitle($plural = FALSE) {
140 return $plural ? ts('Membership Blocks') : ts('Membership Block');
141 }
142
143 /**
144 * Returns foreign keys and entity references.
145 *
146 * @return array
147 * [CRM_Core_Reference_Interface]
148 */
149 public static function getReferenceColumns() {
150 if (!isset(Civi::$statics[__CLASS__]['links'])) {
151 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
152 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'entity_id', 'civicrm_contribution_page', 'id');
153 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'membership_type_default', 'civicrm_membership_type', 'id');
154 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
155 }
156 return Civi::$statics[__CLASS__]['links'];
157 }
158
159 /**
160 * Returns all the column names of this table
161 *
162 * @return array
163 */
164 public static function &fields() {
165 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
166 Civi::$statics[__CLASS__]['fields'] = [
167 'id' => [
168 'name' => 'id',
169 'type' => CRM_Utils_Type::T_INT,
170 'title' => ts('Membership Block ID'),
171 'description' => ts('Membership ID'),
172 'required' => TRUE,
173 'where' => 'civicrm_membership_block.id',
174 'table_name' => 'civicrm_membership_block',
175 'entity' => 'MembershipBlock',
176 'bao' => 'CRM_Member_BAO_MembershipBlock',
177 'localizable' => 0,
178 'html' => [
179 'type' => 'Number',
180 ],
181 'add' => '1.5',
182 ],
183 'entity_table' => [
184 'name' => 'entity_table',
185 'type' => CRM_Utils_Type::T_STRING,
186 'title' => ts('Membership Block Entity Table'),
187 'description' => ts('Name for Membership Status'),
188 'maxlength' => 64,
189 'size' => CRM_Utils_Type::BIG,
190 'where' => 'civicrm_membership_block.entity_table',
191 'table_name' => 'civicrm_membership_block',
192 'entity' => 'MembershipBlock',
193 'bao' => 'CRM_Member_BAO_MembershipBlock',
194 'localizable' => 0,
195 'add' => '1.5',
196 ],
197 'entity_id' => [
198 'name' => 'entity_id',
199 'type' => CRM_Utils_Type::T_INT,
200 'title' => ts('Entity ID'),
201 'description' => ts('FK to civicrm_contribution_page.id'),
202 'required' => TRUE,
203 'where' => 'civicrm_membership_block.entity_id',
204 'table_name' => 'civicrm_membership_block',
205 'entity' => 'MembershipBlock',
206 'bao' => 'CRM_Member_BAO_MembershipBlock',
207 'localizable' => 0,
208 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
209 'html' => [
210 'label' => ts("Entity"),
211 ],
212 'add' => '1.5',
213 ],
214 'membership_types' => [
215 'name' => 'membership_types',
216 'type' => CRM_Utils_Type::T_STRING,
217 'title' => ts('Membership Block Membership Types'),
218 'description' => ts('Membership types to be exposed by this block'),
219 'maxlength' => 1024,
220 'size' => CRM_Utils_Type::HUGE,
221 'where' => 'civicrm_membership_block.membership_types',
222 'table_name' => 'civicrm_membership_block',
223 'entity' => 'MembershipBlock',
224 'bao' => 'CRM_Member_BAO_MembershipBlock',
225 'localizable' => 0,
226 'serialize' => self::SERIALIZE_PHP,
227 'add' => '1.5',
228 ],
229 'membership_type_default' => [
230 'name' => 'membership_type_default',
231 'type' => CRM_Utils_Type::T_INT,
232 'title' => ts('Default Type ID'),
233 'description' => ts('Optional foreign key to membership_type'),
234 'where' => 'civicrm_membership_block.membership_type_default',
235 'table_name' => 'civicrm_membership_block',
236 'entity' => 'MembershipBlock',
237 'bao' => 'CRM_Member_BAO_MembershipBlock',
238 'localizable' => 0,
239 'FKClassName' => 'CRM_Member_DAO_MembershipType',
240 'html' => [
241 'label' => ts("Default Type"),
242 ],
243 'add' => '1.5',
244 ],
245 'display_min_fee' => [
246 'name' => 'display_min_fee',
247 'type' => CRM_Utils_Type::T_BOOLEAN,
248 'title' => ts('Membership Block Display Minimum Fee'),
249 'description' => ts('Display minimum membership fee'),
250 'where' => 'civicrm_membership_block.display_min_fee',
251 'default' => '1',
252 'table_name' => 'civicrm_membership_block',
253 'entity' => 'MembershipBlock',
254 'bao' => 'CRM_Member_BAO_MembershipBlock',
255 'localizable' => 0,
256 'add' => '1.5',
257 ],
258 'is_separate_payment' => [
259 'name' => 'is_separate_payment',
260 'type' => CRM_Utils_Type::T_BOOLEAN,
261 'title' => ts('Membership Block Is Separate Payment'),
262 'description' => ts('Should membership transactions be processed separately'),
263 'where' => 'civicrm_membership_block.is_separate_payment',
264 'default' => '1',
265 'table_name' => 'civicrm_membership_block',
266 'entity' => 'MembershipBlock',
267 'bao' => 'CRM_Member_BAO_MembershipBlock',
268 'localizable' => 0,
269 'add' => '1.5',
270 ],
271 'new_title' => [
272 'name' => 'new_title',
273 'type' => CRM_Utils_Type::T_STRING,
274 'title' => ts('Membership Block New Title'),
275 'description' => ts('Title to display at top of block'),
276 'maxlength' => 255,
277 'size' => CRM_Utils_Type::HUGE,
278 'where' => 'civicrm_membership_block.new_title',
279 'table_name' => 'civicrm_membership_block',
280 'entity' => 'MembershipBlock',
281 'bao' => 'CRM_Member_BAO_MembershipBlock',
282 'localizable' => 1,
283 'add' => '1.5',
284 ],
285 'new_text' => [
286 'name' => 'new_text',
287 'type' => CRM_Utils_Type::T_TEXT,
288 'title' => ts('Membership Block New Text'),
289 'description' => ts('Text to display below title'),
290 'where' => 'civicrm_membership_block.new_text',
291 'table_name' => 'civicrm_membership_block',
292 'entity' => 'MembershipBlock',
293 'bao' => 'CRM_Member_BAO_MembershipBlock',
294 'localizable' => 1,
295 'add' => '1.5',
296 ],
297 'renewal_title' => [
298 'name' => 'renewal_title',
299 'type' => CRM_Utils_Type::T_STRING,
300 'title' => ts('Membership Block Renewal Title'),
301 'description' => ts('Title for renewal'),
302 'maxlength' => 255,
303 'size' => CRM_Utils_Type::HUGE,
304 'where' => 'civicrm_membership_block.renewal_title',
305 'table_name' => 'civicrm_membership_block',
306 'entity' => 'MembershipBlock',
307 'bao' => 'CRM_Member_BAO_MembershipBlock',
308 'localizable' => 1,
309 'add' => '1.5',
310 ],
311 'renewal_text' => [
312 'name' => 'renewal_text',
313 'type' => CRM_Utils_Type::T_TEXT,
314 'title' => ts('Membership Block Renewal Text'),
315 'description' => ts('Text to display for member renewal'),
316 'where' => 'civicrm_membership_block.renewal_text',
317 'table_name' => 'civicrm_membership_block',
318 'entity' => 'MembershipBlock',
319 'bao' => 'CRM_Member_BAO_MembershipBlock',
320 'localizable' => 1,
321 'add' => '1.5',
322 ],
323 'is_required' => [
324 'name' => 'is_required',
325 'type' => CRM_Utils_Type::T_BOOLEAN,
326 'title' => ts('Is Required'),
327 'description' => ts('Is membership sign up optional'),
328 'where' => 'civicrm_membership_block.is_required',
329 'default' => '0',
330 'table_name' => 'civicrm_membership_block',
331 'entity' => 'MembershipBlock',
332 'bao' => 'CRM_Member_BAO_MembershipBlock',
333 'localizable' => 0,
334 'add' => '1.5',
335 ],
336 'is_active' => [
337 'name' => 'is_active',
338 'type' => CRM_Utils_Type::T_BOOLEAN,
339 'title' => ts('Is Active'),
340 'description' => ts('Is this membership_block enabled'),
341 'where' => 'civicrm_membership_block.is_active',
342 'default' => '1',
343 'table_name' => 'civicrm_membership_block',
344 'entity' => 'MembershipBlock',
345 'bao' => 'CRM_Member_BAO_MembershipBlock',
346 'localizable' => 0,
347 'add' => '1.5',
348 ],
349 ];
350 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
351 }
352 return Civi::$statics[__CLASS__]['fields'];
353 }
354
355 /**
356 * Return a mapping from field-name to the corresponding key (as used in fields()).
357 *
358 * @return array
359 * Array(string $name => string $uniqueName).
360 */
361 public static function &fieldKeys() {
362 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
363 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
364 }
365 return Civi::$statics[__CLASS__]['fieldKeys'];
366 }
367
368 /**
369 * Returns the names of this table
370 *
371 * @return string
372 */
373 public static function getTableName() {
374 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
375 }
376
377 /**
378 * Returns if this table needs to be logged
379 *
380 * @return bool
381 */
382 public function getLog() {
383 return self::$_log;
384 }
385
386 /**
387 * Returns the list of fields that can be imported
388 *
389 * @param bool $prefix
390 *
391 * @return array
392 */
393 public static function &import($prefix = FALSE) {
394 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_block', $prefix, []);
395 return $r;
396 }
397
398 /**
399 * Returns the list of fields that can be exported
400 *
401 * @param bool $prefix
402 *
403 * @return array
404 */
405 public static function &export($prefix = FALSE) {
406 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_block', $prefix, []);
407 return $r;
408 }
409
410 /**
411 * Returns the list of indices
412 *
413 * @param bool $localize
414 *
415 * @return array
416 */
417 public static function indices($localize = TRUE) {
418 $indices = [];
419 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
420 }
421
422 }