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:becab4023b8e0c9d10b2081b7002467d)
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',
174 'name' => 'entity_table',
175 'type' => CRM_Utils_Type
::T_STRING
,
176 'title' => ts('Membership Block Entity Table'),
177 'description' => ts('Name for Membership Status'),
179 'size' => CRM_Utils_Type
::BIG
,
180 'where' => 'civicrm_membership_block.entity_table',
181 'table_name' => 'civicrm_membership_block',
182 'entity' => 'MembershipBlock',
183 'bao' => 'CRM_Member_BAO_MembershipBlock',
187 'name' => 'entity_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Membership Block Entity ID'),
190 'description' => ts('FK to civicrm_contribution_page.id'),
192 'where' => 'civicrm_membership_block.entity_id',
193 'table_name' => 'civicrm_membership_block',
194 'entity' => 'MembershipBlock',
195 'bao' => 'CRM_Member_BAO_MembershipBlock',
197 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
199 'membership_types' => [
200 'name' => 'membership_types',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Membership Block Membership Types'),
203 'description' => ts('Membership types to be exposed by this block'),
205 'size' => CRM_Utils_Type
::HUGE
,
206 'where' => 'civicrm_membership_block.membership_types',
207 'table_name' => 'civicrm_membership_block',
208 'entity' => 'MembershipBlock',
209 'bao' => 'CRM_Member_BAO_MembershipBlock',
211 'serialize' => self
::SERIALIZE_PHP
,
213 'membership_type_default' => [
214 'name' => 'membership_type_default',
215 'type' => CRM_Utils_Type
::T_INT
,
216 'title' => ts('Membership Block Default Type'),
217 'description' => ts('Optional foreign key to membership_type'),
218 'where' => 'civicrm_membership_block.membership_type_default',
219 'table_name' => 'civicrm_membership_block',
220 'entity' => 'MembershipBlock',
221 'bao' => 'CRM_Member_BAO_MembershipBlock',
223 'FKClassName' => 'CRM_Member_DAO_MembershipType',
225 'display_min_fee' => [
226 'name' => 'display_min_fee',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Membership Block Display Minimum Fee'),
229 'description' => ts('Display minimum membership fee'),
230 'where' => 'civicrm_membership_block.display_min_fee',
232 'table_name' => 'civicrm_membership_block',
233 'entity' => 'MembershipBlock',
234 'bao' => 'CRM_Member_BAO_MembershipBlock',
237 'is_separate_payment' => [
238 'name' => 'is_separate_payment',
239 'type' => CRM_Utils_Type
::T_BOOLEAN
,
240 'title' => ts('Membership Block Is Separate Payment'),
241 'description' => ts('Should membership transactions be processed separately'),
242 'where' => 'civicrm_membership_block.is_separate_payment',
244 'table_name' => 'civicrm_membership_block',
245 'entity' => 'MembershipBlock',
246 'bao' => 'CRM_Member_BAO_MembershipBlock',
250 'name' => 'new_title',
251 'type' => CRM_Utils_Type
::T_STRING
,
252 'title' => ts('Membership Block New Title'),
253 'description' => ts('Title to display at top of block'),
255 'size' => CRM_Utils_Type
::HUGE
,
256 'where' => 'civicrm_membership_block.new_title',
257 'table_name' => 'civicrm_membership_block',
258 'entity' => 'MembershipBlock',
259 'bao' => 'CRM_Member_BAO_MembershipBlock',
263 'name' => 'new_text',
264 'type' => CRM_Utils_Type
::T_TEXT
,
265 'title' => ts('Membership Block New Text'),
266 'description' => ts('Text to display below title'),
267 'where' => 'civicrm_membership_block.new_text',
268 'table_name' => 'civicrm_membership_block',
269 'entity' => 'MembershipBlock',
270 'bao' => 'CRM_Member_BAO_MembershipBlock',
274 'name' => 'renewal_title',
275 'type' => CRM_Utils_Type
::T_STRING
,
276 'title' => ts('Membership Block Renewal Title'),
277 'description' => ts('Title for renewal'),
279 'size' => CRM_Utils_Type
::HUGE
,
280 'where' => 'civicrm_membership_block.renewal_title',
281 'table_name' => 'civicrm_membership_block',
282 'entity' => 'MembershipBlock',
283 'bao' => 'CRM_Member_BAO_MembershipBlock',
287 'name' => 'renewal_text',
288 'type' => CRM_Utils_Type
::T_TEXT
,
289 'title' => ts('Membership Block Renewal Text'),
290 'description' => ts('Text to display for member renewal'),
291 'where' => 'civicrm_membership_block.renewal_text',
292 'table_name' => 'civicrm_membership_block',
293 'entity' => 'MembershipBlock',
294 'bao' => 'CRM_Member_BAO_MembershipBlock',
298 'name' => 'is_required',
299 'type' => CRM_Utils_Type
::T_BOOLEAN
,
300 'title' => ts('Is Required'),
301 'description' => ts('Is membership sign up optional'),
302 'where' => 'civicrm_membership_block.is_required',
304 'table_name' => 'civicrm_membership_block',
305 'entity' => 'MembershipBlock',
306 'bao' => 'CRM_Member_BAO_MembershipBlock',
310 'name' => 'is_active',
311 'type' => CRM_Utils_Type
::T_BOOLEAN
,
312 'title' => ts('Is Active'),
313 'description' => ts('Is this membership_block enabled'),
314 'where' => 'civicrm_membership_block.is_active',
316 'table_name' => 'civicrm_membership_block',
317 'entity' => 'MembershipBlock',
318 'bao' => 'CRM_Member_BAO_MembershipBlock',
322 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
324 return Civi
::$statics[__CLASS__
]['fields'];
328 * Return a mapping from field-name to the corresponding key (as used in fields()).
331 * Array(string $name => string $uniqueName).
333 public static function &fieldKeys() {
334 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
335 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
337 return Civi
::$statics[__CLASS__
]['fieldKeys'];
341 * Returns the names of this table
345 public static function getTableName() {
346 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
350 * Returns if this table needs to be logged
354 public function getLog() {
359 * Returns the list of fields that can be imported
361 * @param bool $prefix
365 public static function &import($prefix = FALSE) {
366 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, []);
371 * Returns the list of fields that can be exported
373 * @param bool $prefix
377 public static function &export($prefix = FALSE) {
378 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, []);
383 * Returns the list of indices
385 * @param bool $localize
389 public static function indices($localize = TRUE) {
391 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;