3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:7d3680991e8df4820b93c443def8d5d0)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Member_DAO_MembershipBlock constructor.
40 class CRM_Member_DAO_MembershipBlock
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_membership_block';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Name for Membership Status
66 * FK to civicrm_contribution_page.id
72 * Membership types to be exposed by this block
76 public $membership_types;
78 * Optional foreign key to membership_type
82 public $membership_type_default;
84 * Display minimum membership fee
88 public $display_min_fee;
90 * Should membership transactions be processed separately
94 public $is_separate_payment;
96 * Title to display at top of block
102 * Text to display below title
112 public $renewal_title;
114 * Text to display for member renewal
118 public $renewal_text;
120 * Is membership sign up optional
126 * Is this membership_block enabled
134 function __construct() {
135 $this->__table
= 'civicrm_membership_block';
136 parent
::__construct();
139 * Returns foreign keys and entity references.
142 * [CRM_Core_Reference_Interface]
144 static function getReferenceColumns() {
145 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
146 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
147 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'entity_id', 'civicrm_contribution_page', 'id');
148 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'membership_type_default', 'civicrm_membership_type', 'id');
149 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
151 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = array(
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Membership Block ID') ,
165 'description' => 'Membership Id',
167 'table_name' => 'civicrm_membership_block',
168 'entity' => 'MembershipBlock',
169 'bao' => 'CRM_Member_BAO_MembershipBlock',
171 'entity_table' => array(
172 'name' => 'entity_table',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Membership Block Entity Table') ,
175 'description' => 'Name for Membership Status',
177 'size' => CRM_Utils_Type
::BIG
,
178 'table_name' => 'civicrm_membership_block',
179 'entity' => 'MembershipBlock',
180 'bao' => 'CRM_Member_BAO_MembershipBlock',
182 'entity_id' => array(
183 'name' => 'entity_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Membership Block Entity ID') ,
186 'description' => 'FK to civicrm_contribution_page.id',
188 'table_name' => 'civicrm_membership_block',
189 'entity' => 'MembershipBlock',
190 'bao' => 'CRM_Member_BAO_MembershipBlock',
191 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
193 'membership_types' => array(
194 'name' => 'membership_types',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('Membership Block Membership Types') ,
197 'description' => 'Membership types to be exposed by this block',
199 'size' => CRM_Utils_Type
::HUGE
,
200 'table_name' => 'civicrm_membership_block',
201 'entity' => 'MembershipBlock',
202 'bao' => 'CRM_Member_BAO_MembershipBlock',
204 'membership_type_default' => array(
205 'name' => 'membership_type_default',
206 'type' => CRM_Utils_Type
::T_INT
,
207 'title' => ts('Membership Block Default Type') ,
208 'description' => 'Optional foreign key to membership_type',
209 'table_name' => 'civicrm_membership_block',
210 'entity' => 'MembershipBlock',
211 'bao' => 'CRM_Member_BAO_MembershipBlock',
212 'FKClassName' => 'CRM_Member_DAO_MembershipType',
214 'display_min_fee' => array(
215 'name' => 'display_min_fee',
216 'type' => CRM_Utils_Type
::T_BOOLEAN
,
217 'title' => ts('Membership Block Display Minimum Fee') ,
218 'description' => 'Display minimum membership fee',
220 'table_name' => 'civicrm_membership_block',
221 'entity' => 'MembershipBlock',
222 'bao' => 'CRM_Member_BAO_MembershipBlock',
224 'is_separate_payment' => array(
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',
234 'new_title' => array(
235 'name' => 'new_title',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('Membership Block New Title') ,
238 'description' => 'Title to display at top of block',
240 'size' => CRM_Utils_Type
::HUGE
,
241 'table_name' => 'civicrm_membership_block',
242 'entity' => 'MembershipBlock',
243 'bao' => 'CRM_Member_BAO_MembershipBlock',
246 'name' => 'new_text',
247 'type' => CRM_Utils_Type
::T_TEXT
,
248 'title' => ts('Membership Block New Text') ,
249 'description' => 'Text to display below title',
250 'table_name' => 'civicrm_membership_block',
251 'entity' => 'MembershipBlock',
252 'bao' => 'CRM_Member_BAO_MembershipBlock',
254 'renewal_title' => array(
255 'name' => 'renewal_title',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('Membership Block Renewal Title') ,
258 'description' => 'Title for renewal',
260 'size' => CRM_Utils_Type
::HUGE
,
261 'table_name' => 'civicrm_membership_block',
262 'entity' => 'MembershipBlock',
263 'bao' => 'CRM_Member_BAO_MembershipBlock',
265 'renewal_text' => array(
266 'name' => 'renewal_text',
267 'type' => CRM_Utils_Type
::T_TEXT
,
268 'title' => ts('Membership Block Renewal Text') ,
269 'description' => 'Text to display for member renewal',
270 'table_name' => 'civicrm_membership_block',
271 'entity' => 'MembershipBlock',
272 'bao' => 'CRM_Member_BAO_MembershipBlock',
274 'is_required' => array(
275 'name' => 'is_required',
276 'type' => CRM_Utils_Type
::T_BOOLEAN
,
277 'title' => ts('Is Required') ,
278 'description' => 'Is membership sign up optional',
279 'table_name' => 'civicrm_membership_block',
280 'entity' => 'MembershipBlock',
281 'bao' => 'CRM_Member_BAO_MembershipBlock',
283 'is_active' => array(
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('Is Active') ,
287 'description' => 'Is this membership_block enabled',
289 'table_name' => 'civicrm_membership_block',
290 'entity' => 'MembershipBlock',
291 'bao' => 'CRM_Member_BAO_MembershipBlock',
294 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
296 return Civi
::$statics[__CLASS__
]['fields'];
299 * Return a mapping from field-name to the corresponding key (as used in fields()).
302 * Array(string $name => string $uniqueName).
304 static function &fieldKeys() {
305 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
306 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
308 return Civi
::$statics[__CLASS__
]['fieldKeys'];
311 * Returns the names of this table
315 static function getTableName() {
316 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
319 * Returns if this table needs to be logged
327 * Returns the list of fields that can be imported
329 * @param bool $prefix
333 static function &import($prefix = false) {
334 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_block', $prefix, array());
338 * Returns the list of fields that can be exported
340 * @param bool $prefix
344 static function &export($prefix = false) {
345 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_block', $prefix, array());