3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:7b3991d790ed45fb4be2f9d4de4389da)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Member_DAO_MembershipBlock
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_membership_block';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Name for Membership Status
96 * FK to civicrm_contribution_page.id
102 * Membership types to be exposed by this block
106 public $membership_types;
108 * Optional foreign key to membership_type
112 public $membership_type_default;
114 * Display minimum membership fee
118 public $display_min_fee;
120 * Should membership transactions be processed separately
124 public $is_separate_payment;
126 * Title to display at top of block
132 * Text to display below title
142 public $renewal_title;
144 * Text to display for member renewal
148 public $renewal_text;
150 * Is membership sign up optional
156 * Is this membership_block enabled
164 * @return civicrm_membership_block
166 function __construct() {
167 $this->__table
= 'civicrm_membership_block';
168 parent
::__construct();
171 * Returns foreign keys and entity references
174 * [CRM_Core_Reference_Interface]
176 static function getReferenceColumns() {
177 if (!self
::$_links) {
178 self
::$_links = static ::createReferenceColumns(__CLASS__
);
179 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'entity_id', 'civicrm_contribution_page', 'id');
180 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'membership_type_default', 'civicrm_membership_type', 'id');
182 return self
::$_links;
185 * Returns all the column names of this table
189 static function &fields() {
190 if (!(self
::$_fields)) {
191 self
::$_fields = array(
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Membership Block ID') ,
196 'description' => 'Membership Id',
199 'entity_table' => array(
200 'name' => 'entity_table',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Membership Block Entity Table') ,
203 'description' => 'Name for Membership Status',
205 'size' => CRM_Utils_Type
::BIG
,
207 'entity_id' => array(
208 'name' => 'entity_id',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Membership Block Entity ID') ,
211 'description' => 'FK to civicrm_contribution_page.id',
213 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
215 'membership_types' => array(
216 'name' => 'membership_types',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('Membership Block Membership Types') ,
219 'description' => 'Membership types to be exposed by this block',
221 'size' => CRM_Utils_Type
::HUGE
,
223 'membership_type_default' => array(
224 'name' => 'membership_type_default',
225 'type' => CRM_Utils_Type
::T_INT
,
226 'title' => ts('Membership Block Default Type') ,
227 'description' => 'Optional foreign key to membership_type',
228 'FKClassName' => 'CRM_Member_DAO_MembershipType',
230 'display_min_fee' => array(
231 'name' => 'display_min_fee',
232 'type' => CRM_Utils_Type
::T_BOOLEAN
,
233 'title' => ts('Membership Block Display Minimum Fee') ,
234 'description' => 'Display minimum membership fee',
237 'is_separate_payment' => array(
238 'name' => 'is_separate_payment',
239 'type' => CRM_Utils_Type
::T_BOOLEAN
,
240 'title' => ts('Membership Block Is Separate Payment') ,
241 'description' => 'Should membership transactions be processed separately',
244 'new_title' => array(
245 'name' => 'new_title',
246 'type' => CRM_Utils_Type
::T_STRING
,
247 'title' => ts('Membership Block New Title') ,
248 'description' => 'Title to display at top of block',
250 'size' => CRM_Utils_Type
::HUGE
,
253 'name' => 'new_text',
254 'type' => CRM_Utils_Type
::T_TEXT
,
255 'title' => ts('Membership Block New Text') ,
256 'description' => 'Text to display below title',
258 'renewal_title' => array(
259 'name' => 'renewal_title',
260 'type' => CRM_Utils_Type
::T_STRING
,
261 'title' => ts('Membership Block Renewal Title') ,
262 'description' => 'Title for renewal',
264 'size' => CRM_Utils_Type
::HUGE
,
266 'renewal_text' => array(
267 'name' => 'renewal_text',
268 'type' => CRM_Utils_Type
::T_TEXT
,
269 'title' => ts('Membership Block Renewal Text') ,
270 'description' => 'Text to display for member renewal',
272 'is_required' => array(
273 'name' => 'is_required',
274 'type' => CRM_Utils_Type
::T_BOOLEAN
,
275 'title' => ts('Is Required') ,
276 'description' => 'Is membership sign up optional',
278 'is_active' => array(
279 'name' => 'is_active',
280 'type' => CRM_Utils_Type
::T_BOOLEAN
,
281 'title' => ts('Is Active') ,
282 'description' => 'Is this membership_block enabled',
287 return self
::$_fields;
290 * Returns an array containing, for each field, the arary key used for that
291 * field in self::$_fields.
295 static function &fieldKeys() {
296 if (!(self
::$_fieldKeys)) {
297 self
::$_fieldKeys = array(
299 'entity_table' => 'entity_table',
300 'entity_id' => 'entity_id',
301 'membership_types' => 'membership_types',
302 'membership_type_default' => 'membership_type_default',
303 'display_min_fee' => 'display_min_fee',
304 'is_separate_payment' => 'is_separate_payment',
305 'new_title' => 'new_title',
306 'new_text' => 'new_text',
307 'renewal_title' => 'renewal_title',
308 'renewal_text' => 'renewal_text',
309 'is_required' => 'is_required',
310 'is_active' => 'is_active',
313 return self
::$_fieldKeys;
316 * Returns the names of this table
320 static function getTableName() {
321 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
324 * Returns if this table needs to be logged
332 * Returns the list of fields that can be imported
334 * @param bool $prefix
338 static function &import($prefix = false) {
339 if (!(self
::$_import)) {
340 self
::$_import = array();
341 $fields = self
::fields();
342 foreach($fields as $name => $field) {
343 if (CRM_Utils_Array
::value('import', $field)) {
345 self
::$_import['membership_block'] = & $fields[$name];
347 self
::$_import[$name] = & $fields[$name];
352 return self
::$_import;
355 * Returns the list of fields that can be exported
357 * @param bool $prefix
361 static function &export($prefix = false) {
362 if (!(self
::$_export)) {
363 self
::$_export = array();
364 $fields = self
::fields();
365 foreach($fields as $name => $field) {
366 if (CRM_Utils_Array
::value('export', $field)) {
368 self
::$_export['membership_block'] = & $fields[$name];
370 self
::$_export[$name] = & $fields[$name];
375 return self
::$_export;