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/MembershipType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ca9e72dff6418e8d3e0950000e08681a)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Member_DAO_MembershipType constructor.
40 class CRM_Member_DAO_MembershipType
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_membership_type';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Which Domain is this match entry for
66 * Name of Membership Type
72 * Description of Membership Type
78 * Owner organization for this membership type. FK to Contact ID
82 public $member_of_contact_id;
84 * If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id
88 public $financial_type_id;
90 * Minimum fee for this membership (0 for free/complimentary memberships).
96 * Unit in which membership period is expressed.
100 public $duration_unit;
102 * Number of duration units in membership period (e.g. 1 year, 12 months).
106 public $duration_interval;
108 * Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.
114 * For fixed period memberships, month and day (mmdd) on which subscription/membership will start. Period start is back-dated unless after rollover day.
118 public $fixed_period_start_day;
120 * For fixed period memberships, signups after this day (mmdd) rollover to next period.
124 public $fixed_period_rollover_day;
126 * FK to Relationship Type ID
130 public $relationship_type_id;
135 public $relationship_direction;
137 * Maximum number of related memberships.
153 * Receipt Text for membership signup
157 public $receipt_text_signup;
159 * Receipt Text for membership renewal
163 public $receipt_text_renewal;
165 * 0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;
171 * Is this membership_type enabled
179 function __construct() {
180 $this->__table
= 'civicrm_membership_type';
181 parent
::__construct();
184 * Returns foreign keys and entity references.
187 * [CRM_Core_Reference_Interface]
189 static function getReferenceColumns() {
190 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
191 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
192 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
193 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'member_of_contact_id', 'civicrm_contact', 'id');
194 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
195 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
197 return Civi
::$statics[__CLASS__
]['links'];
200 * Returns all the column names of this table
204 static function &fields() {
205 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
206 Civi
::$statics[__CLASS__
]['fields'] = array(
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Membership Type ID') ,
211 'description' => 'Membership Id',
213 'table_name' => 'civicrm_membership_type',
214 'entity' => 'MembershipType',
215 'bao' => 'CRM_Member_BAO_MembershipType',
217 'domain_id' => array(
218 'name' => 'domain_id',
219 'type' => CRM_Utils_Type
::T_INT
,
220 'title' => ts('Membership Type Domain') ,
221 'description' => 'Which Domain is this match entry for',
223 'table_name' => 'civicrm_membership_type',
224 'entity' => 'MembershipType',
225 'bao' => 'CRM_Member_BAO_MembershipType',
226 'FKClassName' => 'CRM_Core_DAO_Domain',
227 'pseudoconstant' => array(
228 'table' => 'civicrm_domain',
230 'labelColumn' => 'name',
233 'membership_type' => array(
235 'type' => CRM_Utils_Type
::T_STRING
,
236 'title' => ts('Membership Type') ,
237 'description' => 'Name of Membership Type',
239 'size' => CRM_Utils_Type
::HUGE
,
241 'where' => 'civicrm_membership_type.name',
242 'headerPattern' => '',
245 'table_name' => 'civicrm_membership_type',
246 'entity' => 'MembershipType',
247 'bao' => 'CRM_Member_BAO_MembershipType',
249 'description' => array(
250 'name' => 'description',
251 'type' => CRM_Utils_Type
::T_STRING
,
252 'title' => ts('Membership Type Description') ,
253 'description' => 'Description of Membership Type',
255 'size' => CRM_Utils_Type
::HUGE
,
256 'table_name' => 'civicrm_membership_type',
257 'entity' => 'MembershipType',
258 'bao' => 'CRM_Member_BAO_MembershipType',
260 'type' => 'TextArea',
263 'member_of_contact_id' => array(
264 'name' => 'member_of_contact_id',
265 'type' => CRM_Utils_Type
::T_INT
,
266 'title' => ts('Membership Type Organization') ,
267 'description' => 'Owner organization for this membership type. FK to Contact ID',
269 'table_name' => 'civicrm_membership_type',
270 'entity' => 'MembershipType',
271 'bao' => 'CRM_Member_BAO_MembershipType',
272 'FKClassName' => 'CRM_Contact_DAO_Contact',
274 'financial_type_id' => array(
275 'name' => 'financial_type_id',
276 'type' => CRM_Utils_Type
::T_INT
,
277 'title' => ts('Membership Financial Type') ,
278 'description' => 'If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id',
280 'table_name' => 'civicrm_membership_type',
281 'entity' => 'MembershipType',
282 'bao' => 'CRM_Member_BAO_MembershipType',
283 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
284 'pseudoconstant' => array(
285 'table' => 'civicrm_financial_type',
287 'labelColumn' => 'name',
290 'minimum_fee' => array(
291 'name' => 'minimum_fee',
292 'type' => CRM_Utils_Type
::T_MONEY
,
293 'title' => ts('membership Type Minimum Fee') ,
294 'description' => 'Minimum fee for this membership (0 for free/complimentary memberships).',
295 'precision' => array(
299 'table_name' => 'civicrm_membership_type',
300 'entity' => 'MembershipType',
301 'bao' => 'CRM_Member_BAO_MembershipType',
303 'duration_unit' => array(
304 'name' => 'duration_unit',
305 'type' => CRM_Utils_Type
::T_STRING
,
306 'title' => ts('Membership Type Duration Unit') ,
307 'description' => 'Unit in which membership period is expressed.',
309 'size' => CRM_Utils_Type
::EIGHT
,
310 'table_name' => 'civicrm_membership_type',
311 'entity' => 'MembershipType',
312 'bao' => 'CRM_Member_BAO_MembershipType',
316 'pseudoconstant' => array(
317 'callback' => 'CRM_Core_SelectValues::membershipTypeUnitList',
320 'duration_interval' => array(
321 'name' => 'duration_interval',
322 'type' => CRM_Utils_Type
::T_INT
,
323 'title' => ts('Membership Type Duration Interval') ,
324 'description' => 'Number of duration units in membership period (e.g. 1 year, 12 months).',
325 'table_name' => 'civicrm_membership_type',
326 'entity' => 'MembershipType',
327 'bao' => 'CRM_Member_BAO_MembershipType',
329 'period_type' => array(
330 'name' => 'period_type',
331 'type' => CRM_Utils_Type
::T_STRING
,
332 'title' => ts('Membership Type Plan') ,
333 'description' => 'Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.',
335 'size' => CRM_Utils_Type
::EIGHT
,
336 'table_name' => 'civicrm_membership_type',
337 'entity' => 'MembershipType',
338 'bao' => 'CRM_Member_BAO_MembershipType',
339 'pseudoconstant' => array(
340 'callback' => 'CRM_Core_SelectValues::periodType',
343 'fixed_period_start_day' => array(
344 'name' => 'fixed_period_start_day',
345 'type' => CRM_Utils_Type
::T_INT
,
346 'title' => ts('Fixed Period Start Day') ,
347 'description' => 'For fixed period memberships, month and day (mmdd) on which subscription/membership will start. Period start is back-dated unless after rollover day.',
348 'table_name' => 'civicrm_membership_type',
349 'entity' => 'MembershipType',
350 'bao' => 'CRM_Member_BAO_MembershipType',
352 'fixed_period_rollover_day' => array(
353 'name' => 'fixed_period_rollover_day',
354 'type' => CRM_Utils_Type
::T_INT
,
355 'title' => ts('Fixed Period Rollover Day') ,
356 'description' => 'For fixed period memberships, signups after this day (mmdd) rollover to next period.',
357 'table_name' => 'civicrm_membership_type',
358 'entity' => 'MembershipType',
359 'bao' => 'CRM_Member_BAO_MembershipType',
361 'relationship_type_id' => array(
362 'name' => 'relationship_type_id',
363 'type' => CRM_Utils_Type
::T_STRING
,
364 'title' => ts('Membership Type Relationship') ,
365 'description' => 'FK to Relationship Type ID',
367 'size' => CRM_Utils_Type
::BIG
,
368 'table_name' => 'civicrm_membership_type',
369 'entity' => 'MembershipType',
370 'bao' => 'CRM_Member_BAO_MembershipType',
372 'relationship_direction' => array(
373 'name' => 'relationship_direction',
374 'type' => CRM_Utils_Type
::T_STRING
,
375 'title' => ts('Relationship Direction') ,
377 'size' => CRM_Utils_Type
::HUGE
,
378 'table_name' => 'civicrm_membership_type',
379 'entity' => 'MembershipType',
380 'bao' => 'CRM_Member_BAO_MembershipType',
382 'max_related' => array(
383 'name' => 'max_related',
384 'type' => CRM_Utils_Type
::T_INT
,
385 'title' => ts('Max Related Members for Type') ,
386 'description' => 'Maximum number of related memberships.',
387 'table_name' => 'civicrm_membership_type',
388 'entity' => 'MembershipType',
389 'bao' => 'CRM_Member_BAO_MembershipType',
391 'visibility' => array(
392 'name' => 'visibility',
393 'type' => CRM_Utils_Type
::T_STRING
,
394 'title' => ts('Visible') ,
396 'size' => CRM_Utils_Type
::BIG
,
397 'table_name' => 'civicrm_membership_type',
398 'entity' => 'MembershipType',
399 'bao' => 'CRM_Member_BAO_MembershipType',
403 'pseudoconstant' => array(
404 'callback' => 'CRM_Core_SelectValues::memberVisibility',
409 'type' => CRM_Utils_Type
::T_INT
,
410 'title' => ts('Order') ,
411 'table_name' => 'civicrm_membership_type',
412 'entity' => 'MembershipType',
413 'bao' => 'CRM_Member_BAO_MembershipType',
415 'receipt_text_signup' => array(
416 'name' => 'receipt_text_signup',
417 'type' => CRM_Utils_Type
::T_STRING
,
418 'title' => ts('Membership Type Receipt Text') ,
419 'description' => 'Receipt Text for membership signup',
421 'size' => CRM_Utils_Type
::HUGE
,
422 'table_name' => 'civicrm_membership_type',
423 'entity' => 'MembershipType',
424 'bao' => 'CRM_Member_BAO_MembershipType',
426 'type' => 'TextArea',
429 'receipt_text_renewal' => array(
430 'name' => 'receipt_text_renewal',
431 'type' => CRM_Utils_Type
::T_STRING
,
432 'title' => ts('Membership Type Renewal Text') ,
433 'description' => 'Receipt Text for membership renewal',
435 'size' => CRM_Utils_Type
::HUGE
,
436 'table_name' => 'civicrm_membership_type',
437 'entity' => 'MembershipType',
438 'bao' => 'CRM_Member_BAO_MembershipType',
440 'type' => 'TextArea',
443 'auto_renew' => array(
444 'name' => 'auto_renew',
445 'type' => CRM_Utils_Type
::T_BOOLEAN
,
446 'title' => ts('Auto Renew') ,
447 'description' => '0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;',
448 'table_name' => 'civicrm_membership_type',
449 'entity' => 'MembershipType',
450 'bao' => 'CRM_Member_BAO_MembershipType',
451 'pseudoconstant' => array(
452 'callback' => 'CRM_Core_SelectValues::memberAutoRenew',
455 'is_active' => array(
456 'name' => 'is_active',
457 'type' => CRM_Utils_Type
::T_BOOLEAN
,
458 'title' => ts('Is Active') ,
459 'description' => 'Is this membership_type enabled',
461 'table_name' => 'civicrm_membership_type',
462 'entity' => 'MembershipType',
463 'bao' => 'CRM_Member_BAO_MembershipType',
466 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
468 return Civi
::$statics[__CLASS__
]['fields'];
471 * Return a mapping from field-name to the corresponding key (as used in fields()).
474 * Array(string $name => string $uniqueName).
476 static function &fieldKeys() {
477 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
478 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
480 return Civi
::$statics[__CLASS__
]['fieldKeys'];
483 * Returns the names of this table
487 static function getTableName() {
488 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
491 * Returns if this table needs to be logged
499 * Returns the list of fields that can be imported
501 * @param bool $prefix
505 static function &import($prefix = false) {
506 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_type', $prefix, array());
510 * Returns the list of fields that can be exported
512 * @param bool $prefix
516 static function &export($prefix = false) {
517 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_type', $prefix, array());