5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:75440d0f30d8ab5d09fa56aa7a9dd8c3)
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 foreign keys and entity references.
134 * [CRM_Core_Reference_Interface]
136 public static function getReferenceColumns() {
137 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
138 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
141 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
143 return Civi
::$statics[__CLASS__
]['links'];
147 * Returns all the column names of this table
151 public static function &fields() {
152 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
153 Civi
::$statics[__CLASS__
]['fields'] = [
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Membership Block ID'),
158 'description' => ts('Membership Id'),
160 'where' => 'civicrm_membership_block.id',
161 'table_name' => 'civicrm_membership_block',
162 'entity' => 'MembershipBlock',
163 'bao' => 'CRM_Member_BAO_MembershipBlock',
167 'name' => 'entity_table',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Membership Block Entity Table'),
170 'description' => ts('Name for Membership Status'),
172 'size' => CRM_Utils_Type
::BIG
,
173 'where' => 'civicrm_membership_block.entity_table',
174 'table_name' => 'civicrm_membership_block',
175 'entity' => 'MembershipBlock',
176 'bao' => 'CRM_Member_BAO_MembershipBlock',
180 'name' => 'entity_id',
181 'type' => CRM_Utils_Type
::T_INT
,
182 'title' => ts('Membership Block Entity ID'),
183 'description' => ts('FK to civicrm_contribution_page.id'),
185 'where' => 'civicrm_membership_block.entity_id',
186 'table_name' => 'civicrm_membership_block',
187 'entity' => 'MembershipBlock',
188 'bao' => 'CRM_Member_BAO_MembershipBlock',
190 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
192 'membership_types' => [
193 'name' => 'membership_types',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Membership Block Membership Types'),
196 'description' => ts('Membership types to be exposed by this block'),
198 'size' => CRM_Utils_Type
::HUGE
,
199 'where' => 'civicrm_membership_block.membership_types',
200 'table_name' => 'civicrm_membership_block',
201 'entity' => 'MembershipBlock',
202 'bao' => 'CRM_Member_BAO_MembershipBlock',
204 'serialize' => self
::SERIALIZE_PHP
,
206 'membership_type_default' => [
207 'name' => 'membership_type_default',
208 'type' => CRM_Utils_Type
::T_INT
,
209 'title' => ts('Membership Block Default Type'),
210 'description' => ts('Optional foreign key to membership_type'),
211 'where' => 'civicrm_membership_block.membership_type_default',
212 'table_name' => 'civicrm_membership_block',
213 'entity' => 'MembershipBlock',
214 'bao' => 'CRM_Member_BAO_MembershipBlock',
216 'FKClassName' => 'CRM_Member_DAO_MembershipType',
218 'display_min_fee' => [
219 'name' => 'display_min_fee',
220 'type' => CRM_Utils_Type
::T_BOOLEAN
,
221 'title' => ts('Membership Block Display Minimum Fee'),
222 'description' => ts('Display minimum membership fee'),
223 'where' => 'civicrm_membership_block.display_min_fee',
225 'table_name' => 'civicrm_membership_block',
226 'entity' => 'MembershipBlock',
227 'bao' => 'CRM_Member_BAO_MembershipBlock',
230 'is_separate_payment' => [
231 'name' => 'is_separate_payment',
232 'type' => CRM_Utils_Type
::T_BOOLEAN
,
233 'title' => ts('Membership Block Is Separate Payment'),
234 'description' => ts('Should membership transactions be processed separately'),
235 'where' => 'civicrm_membership_block.is_separate_payment',
237 'table_name' => 'civicrm_membership_block',
238 'entity' => 'MembershipBlock',
239 'bao' => 'CRM_Member_BAO_MembershipBlock',
243 'name' => 'new_title',
244 'type' => CRM_Utils_Type
::T_STRING
,
245 'title' => ts('Membership Block New Title'),
246 'description' => ts('Title to display at top of block'),
248 'size' => CRM_Utils_Type
::HUGE
,
249 'where' => 'civicrm_membership_block.new_title',
250 'table_name' => 'civicrm_membership_block',
251 'entity' => 'MembershipBlock',
252 'bao' => 'CRM_Member_BAO_MembershipBlock',
256 'name' => 'new_text',
257 'type' => CRM_Utils_Type
::T_TEXT
,
258 'title' => ts('Membership Block New Text'),
259 'description' => ts('Text to display below title'),
260 'where' => 'civicrm_membership_block.new_text',
261 'table_name' => 'civicrm_membership_block',
262 'entity' => 'MembershipBlock',
263 'bao' => 'CRM_Member_BAO_MembershipBlock',
267 'name' => 'renewal_title',
268 'type' => CRM_Utils_Type
::T_STRING
,
269 'title' => ts('Membership Block Renewal Title'),
270 'description' => ts('Title for renewal'),
272 'size' => CRM_Utils_Type
::HUGE
,
273 'where' => 'civicrm_membership_block.renewal_title',
274 'table_name' => 'civicrm_membership_block',
275 'entity' => 'MembershipBlock',
276 'bao' => 'CRM_Member_BAO_MembershipBlock',
280 'name' => 'renewal_text',
281 'type' => CRM_Utils_Type
::T_TEXT
,
282 'title' => ts('Membership Block Renewal Text'),
283 'description' => ts('Text to display for member renewal'),
284 'where' => 'civicrm_membership_block.renewal_text',
285 'table_name' => 'civicrm_membership_block',
286 'entity' => 'MembershipBlock',
287 'bao' => 'CRM_Member_BAO_MembershipBlock',
291 'name' => 'is_required',
292 'type' => CRM_Utils_Type
::T_BOOLEAN
,
293 'title' => ts('Is Required'),
294 'description' => ts('Is membership sign up optional'),
295 'where' => 'civicrm_membership_block.is_required',
297 'table_name' => 'civicrm_membership_block',
298 'entity' => 'MembershipBlock',
299 'bao' => 'CRM_Member_BAO_MembershipBlock',
303 'name' => 'is_active',
304 'type' => CRM_Utils_Type
::T_BOOLEAN
,
305 'title' => ts('Is Active'),
306 'description' => ts('Is this membership_block enabled'),
307 'where' => 'civicrm_membership_block.is_active',
309 'table_name' => 'civicrm_membership_block',
310 'entity' => 'MembershipBlock',
311 'bao' => 'CRM_Member_BAO_MembershipBlock',
315 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
317 return Civi
::$statics[__CLASS__
]['fields'];
321 * Return a mapping from field-name to the corresponding key (as used in fields()).
324 * Array(string $name => string $uniqueName).
326 public static function &fieldKeys() {
327 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
328 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
330 return Civi
::$statics[__CLASS__
]['fieldKeys'];
334 * Returns the names of this table
338 public static function getTableName() {
339 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
343 * Returns if this table needs to be logged
347 public function getLog() {
352 * Returns the list of fields that can be imported
354 * @param bool $prefix
358 public static function &import($prefix = FALSE) {
359 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, []);
364 * Returns the list of fields that can be exported
366 * @param bool $prefix
370 public static function &export($prefix = FALSE) {
371 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, []);
376 * Returns the list of indices
378 * @param bool $localize
382 public static function indices($localize = TRUE) {
384 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;