Merge pull request #19737 from sunilpawar/show_inactive_active_case_role
[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:1f5c13fb36ae0853ed5982f6ca40d65a)
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 'readonly' => TRUE,
182 'add' => '1.5',
183 ],
184 'entity_table' => [
185 'name' => 'entity_table',
186 'type' => CRM_Utils_Type::T_STRING,
187 'title' => ts('Membership Block Entity Table'),
188 'description' => ts('Name for Membership Status'),
189 'maxlength' => 64,
190 'size' => CRM_Utils_Type::BIG,
191 'where' => 'civicrm_membership_block.entity_table',
192 'table_name' => 'civicrm_membership_block',
193 'entity' => 'MembershipBlock',
194 'bao' => 'CRM_Member_BAO_MembershipBlock',
195 'localizable' => 0,
196 'add' => '1.5',
197 ],
198 'entity_id' => [
199 'name' => 'entity_id',
200 'type' => CRM_Utils_Type::T_INT,
201 'title' => ts('Entity ID'),
202 'description' => ts('FK to civicrm_contribution_page.id'),
203 'required' => TRUE,
204 'where' => 'civicrm_membership_block.entity_id',
205 'table_name' => 'civicrm_membership_block',
206 'entity' => 'MembershipBlock',
207 'bao' => 'CRM_Member_BAO_MembershipBlock',
208 'localizable' => 0,
209 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
210 'html' => [
211 'label' => ts("Entity"),
212 ],
213 'add' => '1.5',
214 ],
215 'membership_types' => [
216 'name' => 'membership_types',
217 'type' => CRM_Utils_Type::T_STRING,
218 'title' => ts('Membership Block Membership Types'),
219 'description' => ts('Membership types to be exposed by this block'),
220 'maxlength' => 1024,
221 'size' => CRM_Utils_Type::HUGE,
222 'where' => 'civicrm_membership_block.membership_types',
223 'table_name' => 'civicrm_membership_block',
224 'entity' => 'MembershipBlock',
225 'bao' => 'CRM_Member_BAO_MembershipBlock',
226 'localizable' => 0,
227 'serialize' => self::SERIALIZE_PHP,
228 'add' => '1.5',
229 ],
230 'membership_type_default' => [
231 'name' => 'membership_type_default',
232 'type' => CRM_Utils_Type::T_INT,
233 'title' => ts('Default Type ID'),
234 'description' => ts('Optional foreign key to membership_type'),
235 'where' => 'civicrm_membership_block.membership_type_default',
236 'table_name' => 'civicrm_membership_block',
237 'entity' => 'MembershipBlock',
238 'bao' => 'CRM_Member_BAO_MembershipBlock',
239 'localizable' => 0,
240 'FKClassName' => 'CRM_Member_DAO_MembershipType',
241 'html' => [
242 'label' => ts("Default Type"),
243 ],
244 'add' => '1.5',
245 ],
246 'display_min_fee' => [
247 'name' => 'display_min_fee',
248 'type' => CRM_Utils_Type::T_BOOLEAN,
249 'title' => ts('Membership Block Display Minimum Fee'),
250 'description' => ts('Display minimum membership fee'),
251 'where' => 'civicrm_membership_block.display_min_fee',
252 'default' => '1',
253 'table_name' => 'civicrm_membership_block',
254 'entity' => 'MembershipBlock',
255 'bao' => 'CRM_Member_BAO_MembershipBlock',
256 'localizable' => 0,
257 'add' => '1.5',
258 ],
259 'is_separate_payment' => [
260 'name' => 'is_separate_payment',
261 'type' => CRM_Utils_Type::T_BOOLEAN,
262 'title' => ts('Membership Block Is Separate Payment'),
263 'description' => ts('Should membership transactions be processed separately'),
264 'where' => 'civicrm_membership_block.is_separate_payment',
265 'default' => '1',
266 'table_name' => 'civicrm_membership_block',
267 'entity' => 'MembershipBlock',
268 'bao' => 'CRM_Member_BAO_MembershipBlock',
269 'localizable' => 0,
270 'add' => '1.5',
271 ],
272 'new_title' => [
273 'name' => 'new_title',
274 'type' => CRM_Utils_Type::T_STRING,
275 'title' => ts('Membership Block New Title'),
276 'description' => ts('Title to display at top of block'),
277 'maxlength' => 255,
278 'size' => CRM_Utils_Type::HUGE,
279 'where' => 'civicrm_membership_block.new_title',
280 'table_name' => 'civicrm_membership_block',
281 'entity' => 'MembershipBlock',
282 'bao' => 'CRM_Member_BAO_MembershipBlock',
283 'localizable' => 1,
284 'add' => '1.5',
285 ],
286 'new_text' => [
287 'name' => 'new_text',
288 'type' => CRM_Utils_Type::T_TEXT,
289 'title' => ts('Membership Block New Text'),
290 'description' => ts('Text to display below title'),
291 'where' => 'civicrm_membership_block.new_text',
292 'table_name' => 'civicrm_membership_block',
293 'entity' => 'MembershipBlock',
294 'bao' => 'CRM_Member_BAO_MembershipBlock',
295 'localizable' => 1,
296 'add' => '1.5',
297 ],
298 'renewal_title' => [
299 'name' => 'renewal_title',
300 'type' => CRM_Utils_Type::T_STRING,
301 'title' => ts('Membership Block Renewal Title'),
302 'description' => ts('Title for renewal'),
303 'maxlength' => 255,
304 'size' => CRM_Utils_Type::HUGE,
305 'where' => 'civicrm_membership_block.renewal_title',
306 'table_name' => 'civicrm_membership_block',
307 'entity' => 'MembershipBlock',
308 'bao' => 'CRM_Member_BAO_MembershipBlock',
309 'localizable' => 1,
310 'add' => '1.5',
311 ],
312 'renewal_text' => [
313 'name' => 'renewal_text',
314 'type' => CRM_Utils_Type::T_TEXT,
315 'title' => ts('Membership Block Renewal Text'),
316 'description' => ts('Text to display for member renewal'),
317 'where' => 'civicrm_membership_block.renewal_text',
318 'table_name' => 'civicrm_membership_block',
319 'entity' => 'MembershipBlock',
320 'bao' => 'CRM_Member_BAO_MembershipBlock',
321 'localizable' => 1,
322 'add' => '1.5',
323 ],
324 'is_required' => [
325 'name' => 'is_required',
326 'type' => CRM_Utils_Type::T_BOOLEAN,
327 'title' => ts('Is Required'),
328 'description' => ts('Is membership sign up optional'),
329 'where' => 'civicrm_membership_block.is_required',
330 'default' => '0',
331 'table_name' => 'civicrm_membership_block',
332 'entity' => 'MembershipBlock',
333 'bao' => 'CRM_Member_BAO_MembershipBlock',
334 'localizable' => 0,
335 'add' => '1.5',
336 ],
337 'is_active' => [
338 'name' => 'is_active',
339 'type' => CRM_Utils_Type::T_BOOLEAN,
340 'title' => ts('Is Active'),
341 'description' => ts('Is this membership_block enabled'),
342 'where' => 'civicrm_membership_block.is_active',
343 'default' => '1',
344 'table_name' => 'civicrm_membership_block',
345 'entity' => 'MembershipBlock',
346 'bao' => 'CRM_Member_BAO_MembershipBlock',
347 'localizable' => 0,
348 'add' => '1.5',
349 ],
350 ];
351 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
352 }
353 return Civi::$statics[__CLASS__]['fields'];
354 }
355
356 /**
357 * Return a mapping from field-name to the corresponding key (as used in fields()).
358 *
359 * @return array
360 * Array(string $name => string $uniqueName).
361 */
362 public static function &fieldKeys() {
363 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
364 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
365 }
366 return Civi::$statics[__CLASS__]['fieldKeys'];
367 }
368
369 /**
370 * Returns the names of this table
371 *
372 * @return string
373 */
374 public static function getTableName() {
375 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
376 }
377
378 /**
379 * Returns if this table needs to be logged
380 *
381 * @return bool
382 */
383 public function getLog() {
384 return self::$_log;
385 }
386
387 /**
388 * Returns the list of fields that can be imported
389 *
390 * @param bool $prefix
391 *
392 * @return array
393 */
394 public static function &import($prefix = FALSE) {
395 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_block', $prefix, []);
396 return $r;
397 }
398
399 /**
400 * Returns the list of fields that can be exported
401 *
402 * @param bool $prefix
403 *
404 * @return array
405 */
406 public static function &export($prefix = FALSE) {
407 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_block', $prefix, []);
408 return $r;
409 }
410
411 /**
412 * Returns the list of indices
413 *
414 * @param bool $localize
415 *
416 * @return array
417 */
418 public static function indices($localize = TRUE) {
419 $indices = [];
420 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
421 }
422
423 }