5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:213063eacc89b54159a5b8a9be83e154)
13 * Database access object for the MembershipBlock entity.
15 class CRM_Member_DAO_MembershipBlock
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.5';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_membership_block';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * Name for Membership Status
48 * FK to civicrm_contribution_page.id
55 * Membership types to be exposed by this block
59 public $membership_types;
62 * Optional foreign key to membership_type
66 public $membership_type_default;
69 * Display minimum membership fee
73 public $display_min_fee;
76 * Should membership transactions be processed separately
80 public $is_separate_payment;
83 * Title to display at top of block
90 * Text to display below title
101 public $renewal_title;
104 * Text to display for member renewal
108 public $renewal_text;
111 * Is membership sign up optional
118 * Is this membership_block enabled
127 public function __construct() {
128 $this->__table
= 'civicrm_membership_block';
129 parent
::__construct();
133 * Returns localized title of this entity.
135 * @param bool $plural
136 * Whether to return the plural version of the title.
138 public static function getEntityTitle($plural = FALSE) {
139 return $plural ?
ts('Membership Blocks') : ts('Membership Block');
143 * Returns foreign keys and entity references.
146 * [CRM_Core_Reference_Interface]
148 public static function getReferenceColumns() {
149 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
150 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
151 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'entity_id', 'civicrm_contribution_page', 'id');
152 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'membership_type_default', 'civicrm_membership_type', 'id');
153 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
155 return Civi
::$statics[__CLASS__
]['links'];
159 * Returns all the column names of this table
163 public static function &fields() {
164 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
165 Civi
::$statics[__CLASS__
]['fields'] = [
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Membership Block ID'),
170 'description' => ts('Membership Id'),
172 'where' => 'civicrm_membership_block.id',
173 'table_name' => 'civicrm_membership_block',
174 'entity' => 'MembershipBlock',
175 'bao' => 'CRM_Member_BAO_MembershipBlock',
180 'name' => 'entity_table',
181 'type' => CRM_Utils_Type
::T_STRING
,
182 'title' => ts('Membership Block Entity Table'),
183 'description' => ts('Name for Membership Status'),
185 'size' => CRM_Utils_Type
::BIG
,
186 'where' => 'civicrm_membership_block.entity_table',
187 'table_name' => 'civicrm_membership_block',
188 'entity' => 'MembershipBlock',
189 'bao' => 'CRM_Member_BAO_MembershipBlock',
194 'name' => 'entity_id',
195 'type' => CRM_Utils_Type
::T_INT
,
196 'title' => ts('Membership Block Entity ID'),
197 'description' => ts('FK to civicrm_contribution_page.id'),
199 'where' => 'civicrm_membership_block.entity_id',
200 'table_name' => 'civicrm_membership_block',
201 'entity' => 'MembershipBlock',
202 'bao' => 'CRM_Member_BAO_MembershipBlock',
204 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
207 'membership_types' => [
208 'name' => 'membership_types',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Membership Block Membership Types'),
211 'description' => ts('Membership types to be exposed by this block'),
213 'size' => CRM_Utils_Type
::HUGE
,
214 'where' => 'civicrm_membership_block.membership_types',
215 'table_name' => 'civicrm_membership_block',
216 'entity' => 'MembershipBlock',
217 'bao' => 'CRM_Member_BAO_MembershipBlock',
219 'serialize' => self
::SERIALIZE_PHP
,
222 'membership_type_default' => [
223 'name' => 'membership_type_default',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Membership Block Default Type'),
226 'description' => ts('Optional foreign key to membership_type'),
227 'where' => 'civicrm_membership_block.membership_type_default',
228 'table_name' => 'civicrm_membership_block',
229 'entity' => 'MembershipBlock',
230 'bao' => 'CRM_Member_BAO_MembershipBlock',
232 'FKClassName' => 'CRM_Member_DAO_MembershipType',
235 'display_min_fee' => [
236 'name' => 'display_min_fee',
237 'type' => CRM_Utils_Type
::T_BOOLEAN
,
238 'title' => ts('Membership Block Display Minimum Fee'),
239 'description' => ts('Display minimum membership fee'),
240 'where' => 'civicrm_membership_block.display_min_fee',
242 'table_name' => 'civicrm_membership_block',
243 'entity' => 'MembershipBlock',
244 'bao' => 'CRM_Member_BAO_MembershipBlock',
248 'is_separate_payment' => [
249 'name' => 'is_separate_payment',
250 'type' => CRM_Utils_Type
::T_BOOLEAN
,
251 'title' => ts('Membership Block Is Separate Payment'),
252 'description' => ts('Should membership transactions be processed separately'),
253 'where' => 'civicrm_membership_block.is_separate_payment',
255 'table_name' => 'civicrm_membership_block',
256 'entity' => 'MembershipBlock',
257 'bao' => 'CRM_Member_BAO_MembershipBlock',
262 'name' => 'new_title',
263 'type' => CRM_Utils_Type
::T_STRING
,
264 'title' => ts('Membership Block New Title'),
265 'description' => ts('Title to display at top of block'),
267 'size' => CRM_Utils_Type
::HUGE
,
268 'where' => 'civicrm_membership_block.new_title',
269 'table_name' => 'civicrm_membership_block',
270 'entity' => 'MembershipBlock',
271 'bao' => 'CRM_Member_BAO_MembershipBlock',
276 'name' => 'new_text',
277 'type' => CRM_Utils_Type
::T_TEXT
,
278 'title' => ts('Membership Block New Text'),
279 'description' => ts('Text to display below title'),
280 'where' => 'civicrm_membership_block.new_text',
281 'table_name' => 'civicrm_membership_block',
282 'entity' => 'MembershipBlock',
283 'bao' => 'CRM_Member_BAO_MembershipBlock',
288 'name' => 'renewal_title',
289 'type' => CRM_Utils_Type
::T_STRING
,
290 'title' => ts('Membership Block Renewal Title'),
291 'description' => ts('Title for renewal'),
293 'size' => CRM_Utils_Type
::HUGE
,
294 'where' => 'civicrm_membership_block.renewal_title',
295 'table_name' => 'civicrm_membership_block',
296 'entity' => 'MembershipBlock',
297 'bao' => 'CRM_Member_BAO_MembershipBlock',
302 'name' => 'renewal_text',
303 'type' => CRM_Utils_Type
::T_TEXT
,
304 'title' => ts('Membership Block Renewal Text'),
305 'description' => ts('Text to display for member renewal'),
306 'where' => 'civicrm_membership_block.renewal_text',
307 'table_name' => 'civicrm_membership_block',
308 'entity' => 'MembershipBlock',
309 'bao' => 'CRM_Member_BAO_MembershipBlock',
314 'name' => 'is_required',
315 'type' => CRM_Utils_Type
::T_BOOLEAN
,
316 'title' => ts('Is Required'),
317 'description' => ts('Is membership sign up optional'),
318 'where' => 'civicrm_membership_block.is_required',
320 'table_name' => 'civicrm_membership_block',
321 'entity' => 'MembershipBlock',
322 'bao' => 'CRM_Member_BAO_MembershipBlock',
327 'name' => 'is_active',
328 'type' => CRM_Utils_Type
::T_BOOLEAN
,
329 'title' => ts('Is Active'),
330 'description' => ts('Is this membership_block enabled'),
331 'where' => 'civicrm_membership_block.is_active',
333 'table_name' => 'civicrm_membership_block',
334 'entity' => 'MembershipBlock',
335 'bao' => 'CRM_Member_BAO_MembershipBlock',
340 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
342 return Civi
::$statics[__CLASS__
]['fields'];
346 * Return a mapping from field-name to the corresponding key (as used in fields()).
349 * Array(string $name => string $uniqueName).
351 public static function &fieldKeys() {
352 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
353 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
355 return Civi
::$statics[__CLASS__
]['fieldKeys'];
359 * Returns the names of this table
363 public static function getTableName() {
364 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
368 * Returns if this table needs to be logged
372 public function getLog() {
377 * Returns the list of fields that can be imported
379 * @param bool $prefix
383 public static function &import($prefix = FALSE) {
384 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, []);
389 * Returns the list of fields that can be exported
391 * @param bool $prefix
395 public static function &export($prefix = FALSE) {
396 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, []);
401 * Returns the list of indices
403 * @param bool $localize
407 public static function indices($localize = TRUE) {
409 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;