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