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:317a1eb3c0a67ffe4662f939a0b1fb69)
13 * Database access object for the MembershipBlock entity.
15 class CRM_Member_DAO_MembershipBlock
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_membership_block';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * Name for Membership Status
46 * FK to civicrm_contribution_page.id
53 * Membership types to be exposed by this block
57 public $membership_types;
60 * Optional foreign key to membership_type
64 public $membership_type_default;
67 * Display minimum membership fee
71 public $display_min_fee;
74 * Should membership transactions be processed separately
78 public $is_separate_payment;
81 * Title to display at top of block
88 * Text to display below title
99 public $renewal_title;
102 * Text to display for member renewal
106 public $renewal_text;
109 * Is membership sign up optional
116 * Is this membership_block enabled
125 public function __construct() {
126 $this->__table
= 'civicrm_membership_block';
127 parent
::__construct();
131 * Returns localized title of this entity.
133 public static function getEntityTitle() {
134 return ts('Membership Blocks');
138 * Returns foreign keys and entity references.
141 * [CRM_Core_Reference_Interface]
143 public static function getReferenceColumns() {
144 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
145 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
146 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'entity_id', 'civicrm_contribution_page', 'id');
147 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'membership_type_default', 'civicrm_membership_type', 'id');
148 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
150 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 public static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = [
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Membership Block ID'),
165 'description' => ts('Membership Id'),
167 'where' => 'civicrm_membership_block.id',
168 'table_name' => 'civicrm_membership_block',
169 'entity' => 'MembershipBlock',
170 'bao' => 'CRM_Member_BAO_MembershipBlock',
175 'name' => 'entity_table',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Membership Block Entity Table'),
178 'description' => ts('Name for Membership Status'),
180 'size' => CRM_Utils_Type
::BIG
,
181 'where' => 'civicrm_membership_block.entity_table',
182 'table_name' => 'civicrm_membership_block',
183 'entity' => 'MembershipBlock',
184 'bao' => 'CRM_Member_BAO_MembershipBlock',
189 'name' => 'entity_id',
190 'type' => CRM_Utils_Type
::T_INT
,
191 'title' => ts('Membership Block Entity ID'),
192 'description' => ts('FK to civicrm_contribution_page.id'),
194 'where' => 'civicrm_membership_block.entity_id',
195 'table_name' => 'civicrm_membership_block',
196 'entity' => 'MembershipBlock',
197 'bao' => 'CRM_Member_BAO_MembershipBlock',
199 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
202 'membership_types' => [
203 'name' => 'membership_types',
204 'type' => CRM_Utils_Type
::T_STRING
,
205 'title' => ts('Membership Block Membership Types'),
206 'description' => ts('Membership types to be exposed by this block'),
208 'size' => CRM_Utils_Type
::HUGE
,
209 'where' => 'civicrm_membership_block.membership_types',
210 'table_name' => 'civicrm_membership_block',
211 'entity' => 'MembershipBlock',
212 'bao' => 'CRM_Member_BAO_MembershipBlock',
214 'serialize' => self
::SERIALIZE_PHP
,
217 'membership_type_default' => [
218 'name' => 'membership_type_default',
219 'type' => CRM_Utils_Type
::T_INT
,
220 'title' => ts('Membership Block Default Type'),
221 'description' => ts('Optional foreign key to membership_type'),
222 'where' => 'civicrm_membership_block.membership_type_default',
223 'table_name' => 'civicrm_membership_block',
224 'entity' => 'MembershipBlock',
225 'bao' => 'CRM_Member_BAO_MembershipBlock',
227 'FKClassName' => 'CRM_Member_DAO_MembershipType',
230 'display_min_fee' => [
231 'name' => 'display_min_fee',
232 'type' => CRM_Utils_Type
::T_BOOLEAN
,
233 'title' => ts('Membership Block Display Minimum Fee'),
234 'description' => ts('Display minimum membership fee'),
235 'where' => 'civicrm_membership_block.display_min_fee',
237 'table_name' => 'civicrm_membership_block',
238 'entity' => 'MembershipBlock',
239 'bao' => 'CRM_Member_BAO_MembershipBlock',
243 'is_separate_payment' => [
244 'name' => 'is_separate_payment',
245 'type' => CRM_Utils_Type
::T_BOOLEAN
,
246 'title' => ts('Membership Block Is Separate Payment'),
247 'description' => ts('Should membership transactions be processed separately'),
248 'where' => 'civicrm_membership_block.is_separate_payment',
250 'table_name' => 'civicrm_membership_block',
251 'entity' => 'MembershipBlock',
252 'bao' => 'CRM_Member_BAO_MembershipBlock',
257 'name' => 'new_title',
258 'type' => CRM_Utils_Type
::T_STRING
,
259 'title' => ts('Membership Block New Title'),
260 'description' => ts('Title to display at top of block'),
262 'size' => CRM_Utils_Type
::HUGE
,
263 'where' => 'civicrm_membership_block.new_title',
264 'table_name' => 'civicrm_membership_block',
265 'entity' => 'MembershipBlock',
266 'bao' => 'CRM_Member_BAO_MembershipBlock',
271 'name' => 'new_text',
272 'type' => CRM_Utils_Type
::T_TEXT
,
273 'title' => ts('Membership Block New Text'),
274 'description' => ts('Text to display below title'),
275 'where' => 'civicrm_membership_block.new_text',
276 'table_name' => 'civicrm_membership_block',
277 'entity' => 'MembershipBlock',
278 'bao' => 'CRM_Member_BAO_MembershipBlock',
283 'name' => 'renewal_title',
284 'type' => CRM_Utils_Type
::T_STRING
,
285 'title' => ts('Membership Block Renewal Title'),
286 'description' => ts('Title for renewal'),
288 'size' => CRM_Utils_Type
::HUGE
,
289 'where' => 'civicrm_membership_block.renewal_title',
290 'table_name' => 'civicrm_membership_block',
291 'entity' => 'MembershipBlock',
292 'bao' => 'CRM_Member_BAO_MembershipBlock',
297 'name' => 'renewal_text',
298 'type' => CRM_Utils_Type
::T_TEXT
,
299 'title' => ts('Membership Block Renewal Text'),
300 'description' => ts('Text to display for member renewal'),
301 'where' => 'civicrm_membership_block.renewal_text',
302 'table_name' => 'civicrm_membership_block',
303 'entity' => 'MembershipBlock',
304 'bao' => 'CRM_Member_BAO_MembershipBlock',
309 'name' => 'is_required',
310 'type' => CRM_Utils_Type
::T_BOOLEAN
,
311 'title' => ts('Is Required'),
312 'description' => ts('Is membership sign up optional'),
313 'where' => 'civicrm_membership_block.is_required',
315 'table_name' => 'civicrm_membership_block',
316 'entity' => 'MembershipBlock',
317 'bao' => 'CRM_Member_BAO_MembershipBlock',
322 'name' => 'is_active',
323 'type' => CRM_Utils_Type
::T_BOOLEAN
,
324 'title' => ts('Is Active'),
325 'description' => ts('Is this membership_block enabled'),
326 'where' => 'civicrm_membership_block.is_active',
328 'table_name' => 'civicrm_membership_block',
329 'entity' => 'MembershipBlock',
330 'bao' => 'CRM_Member_BAO_MembershipBlock',
335 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
337 return Civi
::$statics[__CLASS__
]['fields'];
341 * Return a mapping from field-name to the corresponding key (as used in fields()).
344 * Array(string $name => string $uniqueName).
346 public static function &fieldKeys() {
347 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
348 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
350 return Civi
::$statics[__CLASS__
]['fieldKeys'];
354 * Returns the names of this table
358 public static function getTableName() {
359 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
363 * Returns if this table needs to be logged
367 public function getLog() {
372 * Returns the list of fields that can be imported
374 * @param bool $prefix
378 public static function &import($prefix = FALSE) {
379 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, []);
384 * Returns the list of fields that can be exported
386 * @param bool $prefix
390 public static function &export($prefix = FALSE) {
391 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, []);
396 * Returns the list of indices
398 * @param bool $localize
402 public static function indices($localize = TRUE) {
404 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;