5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b99880f7b9c20c98f428dd694d8264ba)
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 static $_tableName = 'civicrm_membership_block';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Membership Id',
160 'table_name' => 'civicrm_membership_block',
161 'entity' => 'MembershipBlock',
162 'bao' => 'CRM_Member_BAO_MembershipBlock',
166 'name' => 'entity_table',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Membership Block Entity Table'),
169 'description' => 'Name for Membership Status',
171 'size' => CRM_Utils_Type
::BIG
,
172 'table_name' => 'civicrm_membership_block',
173 'entity' => 'MembershipBlock',
174 'bao' => 'CRM_Member_BAO_MembershipBlock',
178 'name' => 'entity_id',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Membership Block Entity ID'),
181 'description' => 'FK to civicrm_contribution_page.id',
183 'table_name' => 'civicrm_membership_block',
184 'entity' => 'MembershipBlock',
185 'bao' => 'CRM_Member_BAO_MembershipBlock',
187 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
189 'membership_types' => [
190 'name' => 'membership_types',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('Membership Block Membership Types'),
193 'description' => 'Membership types to be exposed by this block',
195 'size' => CRM_Utils_Type
::HUGE
,
196 'table_name' => 'civicrm_membership_block',
197 'entity' => 'MembershipBlock',
198 'bao' => 'CRM_Member_BAO_MembershipBlock',
200 'serialize' => self
::SERIALIZE_PHP
,
202 'membership_type_default' => [
203 'name' => 'membership_type_default',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Membership Block Default Type'),
206 'description' => 'Optional foreign key to membership_type',
207 'table_name' => 'civicrm_membership_block',
208 'entity' => 'MembershipBlock',
209 'bao' => 'CRM_Member_BAO_MembershipBlock',
211 'FKClassName' => 'CRM_Member_DAO_MembershipType',
213 'display_min_fee' => [
214 'name' => 'display_min_fee',
215 'type' => CRM_Utils_Type
::T_BOOLEAN
,
216 'title' => ts('Membership Block Display Minimum Fee'),
217 'description' => 'Display minimum membership fee',
219 'table_name' => 'civicrm_membership_block',
220 'entity' => 'MembershipBlock',
221 'bao' => 'CRM_Member_BAO_MembershipBlock',
224 'is_separate_payment' => [
225 'name' => 'is_separate_payment',
226 'type' => CRM_Utils_Type
::T_BOOLEAN
,
227 'title' => ts('Membership Block Is Separate Payment'),
228 'description' => 'Should membership transactions be processed separately',
230 'table_name' => 'civicrm_membership_block',
231 'entity' => 'MembershipBlock',
232 'bao' => 'CRM_Member_BAO_MembershipBlock',
236 'name' => 'new_title',
237 'type' => CRM_Utils_Type
::T_STRING
,
238 'title' => ts('Membership Block New Title'),
239 'description' => 'Title to display at top of block',
241 'size' => CRM_Utils_Type
::HUGE
,
242 'table_name' => 'civicrm_membership_block',
243 'entity' => 'MembershipBlock',
244 'bao' => 'CRM_Member_BAO_MembershipBlock',
248 'name' => 'new_text',
249 'type' => CRM_Utils_Type
::T_TEXT
,
250 'title' => ts('Membership Block New Text'),
251 'description' => 'Text to display below title',
252 'table_name' => 'civicrm_membership_block',
253 'entity' => 'MembershipBlock',
254 'bao' => 'CRM_Member_BAO_MembershipBlock',
258 'name' => 'renewal_title',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Membership Block Renewal Title'),
261 'description' => 'Title for renewal',
263 'size' => CRM_Utils_Type
::HUGE
,
264 'table_name' => 'civicrm_membership_block',
265 'entity' => 'MembershipBlock',
266 'bao' => 'CRM_Member_BAO_MembershipBlock',
270 'name' => 'renewal_text',
271 'type' => CRM_Utils_Type
::T_TEXT
,
272 'title' => ts('Membership Block Renewal Text'),
273 'description' => 'Text to display for member renewal',
274 'table_name' => 'civicrm_membership_block',
275 'entity' => 'MembershipBlock',
276 'bao' => 'CRM_Member_BAO_MembershipBlock',
280 'name' => 'is_required',
281 'type' => CRM_Utils_Type
::T_BOOLEAN
,
282 'title' => ts('Is Required'),
283 'description' => 'Is membership sign up optional',
285 'table_name' => 'civicrm_membership_block',
286 'entity' => 'MembershipBlock',
287 'bao' => 'CRM_Member_BAO_MembershipBlock',
291 'name' => 'is_active',
292 'type' => CRM_Utils_Type
::T_BOOLEAN
,
293 'title' => ts('Is Active'),
294 'description' => 'Is this membership_block enabled',
296 'table_name' => 'civicrm_membership_block',
297 'entity' => 'MembershipBlock',
298 'bao' => 'CRM_Member_BAO_MembershipBlock',
302 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
304 return Civi
::$statics[__CLASS__
]['fields'];
308 * Return a mapping from field-name to the corresponding key (as used in fields()).
311 * Array(string $name => string $uniqueName).
313 public static function &fieldKeys() {
314 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
315 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
317 return Civi
::$statics[__CLASS__
]['fieldKeys'];
321 * Returns the names of this table
325 public static function getTableName() {
326 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
330 * Returns if this table needs to be logged
334 public function getLog() {
339 * Returns the list of fields that can be imported
341 * @param bool $prefix
345 public static function &import($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, []);
351 * Returns the list of fields that can be exported
353 * @param bool $prefix
357 public static function &export($prefix = FALSE) {
358 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, []);
363 * Returns the list of indices
365 * @param bool $localize
369 public static function indices($localize = TRUE) {
371 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;