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:1f5c13fb36ae0853ed5982f6ca40d65a)
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';
18 const COMPONENT
= 'CiviMember';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_membership_block';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
42 * Name for Membership Status
49 * FK to civicrm_contribution_page.id
56 * Membership types to be exposed by this block
60 public $membership_types;
63 * Optional foreign key to membership_type
67 public $membership_type_default;
70 * Display minimum membership fee
74 public $display_min_fee;
77 * Should membership transactions be processed separately
81 public $is_separate_payment;
84 * Title to display at top of block
91 * Text to display below title
102 public $renewal_title;
105 * Text to display for member renewal
109 public $renewal_text;
112 * Is membership sign up optional
119 * Is this membership_block enabled
128 public function __construct() {
129 $this->__table
= 'civicrm_membership_block';
130 parent
::__construct();
134 * Returns localized title of this entity.
136 * @param bool $plural
137 * Whether to return the plural version of the title.
139 public static function getEntityTitle($plural = FALSE) {
140 return $plural ?
ts('Membership Blocks') : ts('Membership Block');
144 * Returns foreign keys and entity references.
147 * [CRM_Core_Reference_Interface]
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']);
156 return Civi
::$statics[__CLASS__
]['links'];
160 * Returns all the column names of this table
164 public static function &fields() {
165 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
166 Civi
::$statics[__CLASS__
]['fields'] = [
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Membership Block ID'),
171 'description' => ts('Membership ID'),
173 'where' => 'civicrm_membership_block.id',
174 'table_name' => 'civicrm_membership_block',
175 'entity' => 'MembershipBlock',
176 'bao' => 'CRM_Member_BAO_MembershipBlock',
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'),
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',
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'),
204 'where' => 'civicrm_membership_block.entity_id',
205 'table_name' => 'civicrm_membership_block',
206 'entity' => 'MembershipBlock',
207 'bao' => 'CRM_Member_BAO_MembershipBlock',
209 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
211 'label' => ts("Entity"),
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'),
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',
227 'serialize' => self
::SERIALIZE_PHP
,
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',
240 'FKClassName' => 'CRM_Member_DAO_MembershipType',
242 'label' => ts("Default Type"),
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',
253 'table_name' => 'civicrm_membership_block',
254 'entity' => 'MembershipBlock',
255 'bao' => 'CRM_Member_BAO_MembershipBlock',
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',
266 'table_name' => 'civicrm_membership_block',
267 'entity' => 'MembershipBlock',
268 'bao' => 'CRM_Member_BAO_MembershipBlock',
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'),
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',
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',
299 'name' => 'renewal_title',
300 'type' => CRM_Utils_Type
::T_STRING
,
301 'title' => ts('Membership Block Renewal Title'),
302 'description' => ts('Title for renewal'),
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',
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',
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',
331 'table_name' => 'civicrm_membership_block',
332 'entity' => 'MembershipBlock',
333 'bao' => 'CRM_Member_BAO_MembershipBlock',
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',
344 'table_name' => 'civicrm_membership_block',
345 'entity' => 'MembershipBlock',
346 'bao' => 'CRM_Member_BAO_MembershipBlock',
351 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
353 return Civi
::$statics[__CLASS__
]['fields'];
357 * Return a mapping from field-name to the corresponding key (as used in fields()).
360 * Array(string $name => string $uniqueName).
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()));
366 return Civi
::$statics[__CLASS__
]['fieldKeys'];
370 * Returns the names of this table
374 public static function getTableName() {
375 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
379 * Returns if this table needs to be logged
383 public function getLog() {
388 * Returns the list of fields that can be imported
390 * @param bool $prefix
394 public static function &import($prefix = FALSE) {
395 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, []);
400 * Returns the list of fields that can be exported
402 * @param bool $prefix
406 public static function &export($prefix = FALSE) {
407 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, []);
412 * Returns the list of indices
414 * @param bool $localize
418 public static function indices($localize = TRUE) {
420 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;