First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
999
sites/all/modules/civicrm/CRM/Contribute/DAO/Contribution.php
Normal file
999
sites/all/modules/civicrm/CRM/Contribute/DAO/Contribution.php
Normal file
|
@ -0,0 +1,999 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/Contribution.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:45a20d00d01766a61687cbac5cef1482)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_Contribution constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contribution';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Contribution ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* FK to Contact ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* FK to Financial Type for (total_amount - non_deductible_amount).
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $financial_type_id;
|
||||
/**
|
||||
* The Contribution Page which triggered this contribution
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_page_id;
|
||||
/**
|
||||
* FK to Payment Instrument
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $payment_instrument_id;
|
||||
/**
|
||||
* Date contribution was received - not necessarily the creation date of the record
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $receive_date;
|
||||
/**
|
||||
* Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $non_deductible_amount;
|
||||
/**
|
||||
* Total amount of this contribution. Use market value for non-monetary gifts.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $total_amount;
|
||||
/**
|
||||
* actual processor fee if known - may be 0.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $fee_amount;
|
||||
/**
|
||||
* actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $net_amount;
|
||||
/**
|
||||
* unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $trxn_id;
|
||||
/**
|
||||
* unique invoice id, system generated or passed in
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $invoice_id;
|
||||
/**
|
||||
* Human readable invoice number
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $invoice_number;
|
||||
/**
|
||||
* 3 character string, value from config setting or input via user.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $currency;
|
||||
/**
|
||||
* when was gift cancelled
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $cancel_date;
|
||||
/**
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $cancel_reason;
|
||||
/**
|
||||
* when (if) receipt was sent. populated automatically for online donations w/ automatic receipting
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $receipt_date;
|
||||
/**
|
||||
* when (if) was donor thanked
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $thankyou_date;
|
||||
/**
|
||||
* Origin of this Contribution.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $source;
|
||||
/**
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $amount_level;
|
||||
/**
|
||||
* Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_recur_id;
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_test;
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_pay_later;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_status_id;
|
||||
/**
|
||||
* Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $address_id;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $check_number;
|
||||
/**
|
||||
* The campaign for which this contribution has been triggered.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $campaign_id;
|
||||
/**
|
||||
* unique credit note id, system generated or passed in
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $creditnote_id;
|
||||
/**
|
||||
* Total tax amount of this contribution.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $tax_amount;
|
||||
/**
|
||||
* Stores the date when revenue should be recognized.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $revenue_recognition_date;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contribution';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_recur_id', 'civicrm_contribution_recur', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'address_id', 'civicrm_address', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'contribution_id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution ID') ,
|
||||
'description' => 'Contribution ID',
|
||||
'required' => true,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'FK to Contact ID',
|
||||
'required' => true,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.contact_id',
|
||||
'headerPattern' => '/contact(.?id)?/i',
|
||||
'dataPattern' => '/^\d+$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
'html' => array(
|
||||
'type' => 'EntityRef',
|
||||
) ,
|
||||
) ,
|
||||
'financial_type_id' => array(
|
||||
'name' => 'financial_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Financial Type') ,
|
||||
'description' => 'FK to Financial Type for (total_amount - non_deductible_amount).',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution.financial_type_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_FinancialType',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_financial_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'contribution_page_id' => array(
|
||||
'name' => 'contribution_page_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Page ID') ,
|
||||
'description' => 'The Contribution Page which triggered this contribution',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.contribution_page_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_contribution_page',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'payment_instrument_id' => array(
|
||||
'name' => 'payment_instrument_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Payment Method ID') ,
|
||||
'description' => 'FK to Payment Instrument',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution.payment_instrument_id',
|
||||
'headerPattern' => '/^payment|(p(ayment\s)?instrument)$/i',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'payment_instrument',
|
||||
'optionEditPath' => 'civicrm/admin/options/payment_instrument',
|
||||
)
|
||||
) ,
|
||||
'receive_date' => array(
|
||||
'name' => 'receive_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Date Received') ,
|
||||
'description' => 'Date contribution was received - not necessarily the creation date of the record',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.receive_date',
|
||||
'headerPattern' => '/receive(.?date)?/i',
|
||||
'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
'formatType' => 'activityDateTime',
|
||||
) ,
|
||||
) ,
|
||||
'non_deductible_amount' => array(
|
||||
'name' => 'non_deductible_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Non-deductible Amount') ,
|
||||
'description' => 'Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.non_deductible_amount',
|
||||
'headerPattern' => '/non?.?deduct/i',
|
||||
'dataPattern' => '/^\d+(\.\d{2})?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'total_amount' => array(
|
||||
'name' => 'total_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Total Amount') ,
|
||||
'description' => 'Total amount of this contribution. Use market value for non-monetary gifts.',
|
||||
'required' => true,
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.total_amount',
|
||||
'headerPattern' => '/^total|(.?^am(ou)?nt)/i',
|
||||
'dataPattern' => '/^\d+(\.\d{2})?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'fee_amount' => array(
|
||||
'name' => 'fee_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Fee Amount') ,
|
||||
'description' => 'actual processor fee if known - may be 0.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.fee_amount',
|
||||
'headerPattern' => '/fee(.?am(ou)?nt)?/i',
|
||||
'dataPattern' => '/^\d+(\.\d{2})?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'net_amount' => array(
|
||||
'name' => 'net_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Net Amount') ,
|
||||
'description' => 'actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.net_amount',
|
||||
'headerPattern' => '/net(.?am(ou)?nt)?/i',
|
||||
'dataPattern' => '/^\d+(\.\d{2})?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'trxn_id' => array(
|
||||
'name' => 'trxn_id',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Transaction ID') ,
|
||||
'description' => 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.trxn_id',
|
||||
'headerPattern' => '/tr(ansactio|x)n(.?id)?/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'invoice_id' => array(
|
||||
'name' => 'invoice_id',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Invoice Reference') ,
|
||||
'description' => 'unique invoice id, system generated or passed in',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.invoice_id',
|
||||
'headerPattern' => '/invoice(.?id)?/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'invoice_number' => array(
|
||||
'name' => 'invoice_number',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Invoice Number') ,
|
||||
'description' => 'Human readable invoice number',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.invoice_number',
|
||||
'headerPattern' => '/invoice(.?number)?/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'currency' => array(
|
||||
'name' => 'currency',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Currency') ,
|
||||
'description' => '3 character string, value from config setting or input via user.',
|
||||
'maxlength' => 3,
|
||||
'size' => CRM_Utils_Type::FOUR,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.currency',
|
||||
'headerPattern' => '/cur(rency)?/i',
|
||||
'dataPattern' => '/^[A-Z]{3}$/i',
|
||||
'export' => true,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_currency',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'full_name',
|
||||
'nameColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'cancel_date' => array(
|
||||
'name' => 'cancel_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Cancel Date') ,
|
||||
'description' => 'when was gift cancelled',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.cancel_date',
|
||||
'headerPattern' => '/cancel(.?date)?/i',
|
||||
'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
'formatType' => 'activityDateTime',
|
||||
) ,
|
||||
) ,
|
||||
'cancel_reason' => array(
|
||||
'name' => 'cancel_reason',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Cancel Reason') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.cancel_reason',
|
||||
'headerPattern' => '/(cancel.?)?reason/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'receipt_date' => array(
|
||||
'name' => 'receipt_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Receipt Date') ,
|
||||
'description' => 'when (if) receipt was sent. populated automatically for online donations w/ automatic receipting',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.receipt_date',
|
||||
'headerPattern' => '/receipt(.?date)?/i',
|
||||
'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
'formatType' => 'activityDateTime',
|
||||
) ,
|
||||
) ,
|
||||
'thankyou_date' => array(
|
||||
'name' => 'thankyou_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Thank-you Date') ,
|
||||
'description' => 'when (if) was donor thanked',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.thankyou_date',
|
||||
'headerPattern' => '/thank(s|(.?you))?(.?date)?/i',
|
||||
'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
'formatType' => 'activityDateTime',
|
||||
) ,
|
||||
) ,
|
||||
'contribution_source' => array(
|
||||
'name' => 'source',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contribution Source') ,
|
||||
'description' => 'Origin of this Contribution.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.source',
|
||||
'headerPattern' => '/source/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'amount_level' => array(
|
||||
'name' => 'amount_level',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Amount Label') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.amount_level',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'contribution_recur_id' => array(
|
||||
'name' => 'contribution_recur_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Recurring Contribution ID') ,
|
||||
'description' => 'Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution.contribution_recur_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur',
|
||||
) ,
|
||||
'is_test' => array(
|
||||
'name' => 'is_test',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Test') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.is_test',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'is_pay_later' => array(
|
||||
'name' => 'is_pay_later',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Pay Later') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.is_pay_later',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'contribution_status_id' => array(
|
||||
'name' => 'contribution_status_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Status ID') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.contribution_status_id',
|
||||
'headerPattern' => '/status/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'contribution_status',
|
||||
'optionEditPath' => 'civicrm/admin/options/contribution_status',
|
||||
)
|
||||
) ,
|
||||
'contribution_address_id' => array(
|
||||
'name' => 'address_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Address') ,
|
||||
'description' => 'Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution.address_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Core_DAO_Address',
|
||||
) ,
|
||||
'contribution_check_number' => array(
|
||||
'name' => 'check_number',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Check Number') ,
|
||||
'maxlength' => 255,
|
||||
'size' => 6,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.check_number',
|
||||
'headerPattern' => '/check(.?number)?/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'contribution_campaign_id' => array(
|
||||
'name' => 'campaign_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign') ,
|
||||
'description' => 'The campaign for which this contribution has been triggered.',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.campaign_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_campaign',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'creditnote_id' => array(
|
||||
'name' => 'creditnote_id',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Credit Note ID') ,
|
||||
'description' => 'unique credit note id, system generated or passed in',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.creditnote_id',
|
||||
'headerPattern' => '/creditnote(.?id)?/i',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'tax_amount' => array(
|
||||
'name' => 'tax_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Tax Amount') ,
|
||||
'description' => 'Total tax amount of this contribution.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.tax_amount',
|
||||
'headerPattern' => '/tax(.?am(ou)?nt)?/i',
|
||||
'dataPattern' => '/^\d+(\.\d{2})?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'revenue_recognition_date' => array(
|
||||
'name' => 'revenue_recognition_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Revenue Recognition Date') ,
|
||||
'description' => 'Stores the date when revenue should be recognized.',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution.revenue_recognition_date',
|
||||
'headerPattern' => '/revenue(.?date)?/i',
|
||||
'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution',
|
||||
'entity' => 'Contribution',
|
||||
'bao' => 'CRM_Contribute_BAO_Contribution',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
'formatType' => 'activityDateTime',
|
||||
) ,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_contrib_payment_instrument_id' => array(
|
||||
'name' => 'UI_contrib_payment_instrument_id',
|
||||
'field' => array(
|
||||
0 => 'payment_instrument_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::payment_instrument_id',
|
||||
) ,
|
||||
'index_total_amount_receive_date' => array(
|
||||
'name' => 'index_total_amount_receive_date',
|
||||
'field' => array(
|
||||
0 => 'total_amount',
|
||||
1 => 'receive_date',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::total_amount::receive_date',
|
||||
) ,
|
||||
'index_source' => array(
|
||||
'name' => 'index_source',
|
||||
'field' => array(
|
||||
0 => 'source',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::source',
|
||||
) ,
|
||||
'UI_contrib_trxn_id' => array(
|
||||
'name' => 'UI_contrib_trxn_id',
|
||||
'field' => array(
|
||||
0 => 'trxn_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_contribution::1::trxn_id',
|
||||
) ,
|
||||
'UI_contrib_invoice_id' => array(
|
||||
'name' => 'UI_contrib_invoice_id',
|
||||
'field' => array(
|
||||
0 => 'invoice_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_contribution::1::invoice_id',
|
||||
) ,
|
||||
'index_contribution_status' => array(
|
||||
'name' => 'index_contribution_status',
|
||||
'field' => array(
|
||||
0 => 'contribution_status_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::contribution_status_id',
|
||||
) ,
|
||||
'received_date' => array(
|
||||
'name' => 'received_date',
|
||||
'field' => array(
|
||||
0 => 'receive_date',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::receive_date',
|
||||
) ,
|
||||
'check_number' => array(
|
||||
'name' => 'check_number',
|
||||
'field' => array(
|
||||
0 => 'check_number',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::check_number',
|
||||
) ,
|
||||
'index_creditnote_id' => array(
|
||||
'name' => 'index_creditnote_id',
|
||||
'field' => array(
|
||||
0 => 'creditnote_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution::0::creditnote_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,966 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/ContributionPage.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:00d0eb39eb657241b67e9d5b12bc09d8)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_ContributionPage constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contribution_page';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Contribution Id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Contribution Page title. For top of page display
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* Text and html allowed. Displayed below title.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $intro_text;
|
||||
/**
|
||||
* default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $financial_type_id;
|
||||
/**
|
||||
* Payment Processors configured for this contribution Page
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $payment_processor;
|
||||
/**
|
||||
* if true - processing logic must reject transaction at confirmation stage if pay method != credit card
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_credit_card_only;
|
||||
/**
|
||||
* if true - allows real-time monetary transactions otherwise non-monetary transactions
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_monetary;
|
||||
/**
|
||||
* if true - allows recurring contributions, valid only for PayPal_Standard
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_recur;
|
||||
/**
|
||||
* if false, the confirm page in contribution pages gets skipped
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_confirm_enabled;
|
||||
/**
|
||||
* Supported recurring frequency units.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $recur_frequency_unit;
|
||||
/**
|
||||
* if true - supports recurring intervals
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_recur_interval;
|
||||
/**
|
||||
* if true - asks user for recurring installments
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_recur_installments;
|
||||
/**
|
||||
* if true - user is able to adjust payment start date
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $adjust_recur_start_date;
|
||||
/**
|
||||
* if true - allows the user to send payment directly to the org later
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_pay_later;
|
||||
/**
|
||||
* The text displayed to the user in the main form
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $pay_later_text;
|
||||
/**
|
||||
* The receipt sent to the user instead of the normal receipt text
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $pay_later_receipt;
|
||||
/**
|
||||
* is partial payment enabled for this online contribution page
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_partial_payment;
|
||||
/**
|
||||
* Initial amount label for partial payment
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $initial_amount_label;
|
||||
/**
|
||||
* Initial amount help text for partial payment
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $initial_amount_help_text;
|
||||
/**
|
||||
* Minimum initial amount for partial payment
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $min_initial_amount;
|
||||
/**
|
||||
* if true, page will include an input text field where user can enter their own amount
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_allow_other_amount;
|
||||
/**
|
||||
* FK to civicrm_option_value.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $default_amount_id;
|
||||
/**
|
||||
* if other amounts allowed, user can configure minimum allowed.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $min_amount;
|
||||
/**
|
||||
* if other amounts allowed, user can configure maximum allowed.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $max_amount;
|
||||
/**
|
||||
* The target goal for this page, allows people to build a goal meter
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $goal_amount;
|
||||
/**
|
||||
* Title for Thank-you page (header title tag, and display at the top of the page).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $thankyou_title;
|
||||
/**
|
||||
* text and html allowed. displayed above result on success page
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $thankyou_text;
|
||||
/**
|
||||
* Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $thankyou_footer;
|
||||
/**
|
||||
* if true, receipt is automatically emailed to contact on success
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_email_receipt;
|
||||
/**
|
||||
* FROM email name used for receipts generated by contributions to this contribution page.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $receipt_from_name;
|
||||
/**
|
||||
* FROM email address used for receipts generated by contributions to this contribution page.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $receipt_from_email;
|
||||
/**
|
||||
* comma-separated list of email addresses to cc each time a receipt is sent
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $cc_receipt;
|
||||
/**
|
||||
* comma-separated list of email addresses to bcc each time a receipt is sent
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $bcc_receipt;
|
||||
/**
|
||||
* text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $receipt_text;
|
||||
/**
|
||||
* Is this property active?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $footer_text;
|
||||
/**
|
||||
* Is this property active?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $amount_block_is_active;
|
||||
/**
|
||||
* Date and time that this page starts.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $start_date;
|
||||
/**
|
||||
* Date and time that this page ends. May be NULL if no defined end date/time
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $end_date;
|
||||
/**
|
||||
* FK to civicrm_contact, who created this contribution page
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $created_id;
|
||||
/**
|
||||
* Date and time that contribution page was created.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $created_date;
|
||||
/**
|
||||
* 3 character string, value from config setting or input via user.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $currency;
|
||||
/**
|
||||
* The campaign for which we are collecting contributions with this page.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $campaign_id;
|
||||
/**
|
||||
* Can people share the contribution page through social media?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_share;
|
||||
/**
|
||||
* if true - billing block is required for online contribution page
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_billing_required;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contribution_page';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Page ID') ,
|
||||
'description' => 'Contribution Id',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'title' => array(
|
||||
'name' => 'title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contribution Page Title') ,
|
||||
'description' => 'Contribution Page title. For top of page display',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'intro_text' => array(
|
||||
'name' => 'intro_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Contribution Page Introduction Text') ,
|
||||
'description' => 'Text and html allowed. Displayed below title.',
|
||||
'rows' => 6,
|
||||
'cols' => 50,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'RichTextEditor',
|
||||
) ,
|
||||
) ,
|
||||
'financial_type_id' => array(
|
||||
'name' => 'financial_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Financial Type') ,
|
||||
'description' => 'default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_FinancialType',
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_financial_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'payment_processor' => array(
|
||||
'name' => 'payment_processor',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Payment Processor') ,
|
||||
'description' => 'Payment Processors configured for this contribution Page',
|
||||
'maxlength' => 128,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_payment_processor',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'is_credit_card_only' => array(
|
||||
'name' => 'is_credit_card_only',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Credit Card Only?') ,
|
||||
'description' => 'if true - processing logic must reject transaction at confirmation stage if pay method != credit card',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_monetary' => array(
|
||||
'name' => 'is_monetary',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Monetary') ,
|
||||
'description' => 'if true - allows real-time monetary transactions otherwise non-monetary transactions',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_recur' => array(
|
||||
'name' => 'is_recur',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Recurring') ,
|
||||
'description' => 'if true - allows recurring contributions, valid only for PayPal_Standard',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_confirm_enabled' => array(
|
||||
'name' => 'is_confirm_enabled',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Confirmation Page?') ,
|
||||
'description' => 'if false, the confirm page in contribution pages gets skipped',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'recur_frequency_unit' => array(
|
||||
'name' => 'recur_frequency_unit',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Recurring Frequency') ,
|
||||
'description' => 'Supported recurring frequency units.',
|
||||
'maxlength' => 128,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_recur_interval' => array(
|
||||
'name' => 'is_recur_interval',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Support Recurring Intervals') ,
|
||||
'description' => 'if true - supports recurring intervals',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_recur_installments' => array(
|
||||
'name' => 'is_recur_installments',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Recurring Installments?') ,
|
||||
'description' => 'if true - asks user for recurring installments',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'adjust_recur_start_date' => array(
|
||||
'name' => 'adjust_recur_start_date',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Adjust Recurring Start Date') ,
|
||||
'description' => 'if true - user is able to adjust payment start date',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_pay_later' => array(
|
||||
'name' => 'is_pay_later',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Pay Later') ,
|
||||
'description' => 'if true - allows the user to send payment directly to the org later',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'pay_later_text' => array(
|
||||
'name' => 'pay_later_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Pay Later Text') ,
|
||||
'description' => 'The text displayed to the user in the main form',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'pay_later_receipt' => array(
|
||||
'name' => 'pay_later_receipt',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Pay Later Receipt') ,
|
||||
'description' => 'The receipt sent to the user instead of the normal receipt text',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'is_partial_payment' => array(
|
||||
'name' => 'is_partial_payment',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Allow Partial Payment') ,
|
||||
'description' => 'is partial payment enabled for this online contribution page',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'initial_amount_label' => array(
|
||||
'name' => 'initial_amount_label',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Initial Amount Label') ,
|
||||
'description' => 'Initial amount label for partial payment',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'initial_amount_help_text' => array(
|
||||
'name' => 'initial_amount_help_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Initial Amount Help Text') ,
|
||||
'description' => 'Initial amount help text for partial payment',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'min_initial_amount' => array(
|
||||
'name' => 'min_initial_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Min Initial Amount') ,
|
||||
'description' => 'Minimum initial amount for partial payment',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_allow_other_amount' => array(
|
||||
'name' => 'is_allow_other_amount',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Allow Other Amounts') ,
|
||||
'description' => 'if true, page will include an input text field where user can enter their own amount',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'default_amount_id' => array(
|
||||
'name' => 'default_amount_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Default Amount') ,
|
||||
'description' => 'FK to civicrm_option_value.',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'min_amount' => array(
|
||||
'name' => 'min_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Minimum Amount') ,
|
||||
'description' => 'if other amounts allowed, user can configure minimum allowed.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'max_amount' => array(
|
||||
'name' => 'max_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Maximum Amount') ,
|
||||
'description' => 'if other amounts allowed, user can configure maximum allowed.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'goal_amount' => array(
|
||||
'name' => 'goal_amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Goal Amount') ,
|
||||
'description' => 'The target goal for this page, allows people to build a goal meter',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'thankyou_title' => array(
|
||||
'name' => 'thankyou_title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Thank-you Title') ,
|
||||
'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'thankyou_text' => array(
|
||||
'name' => 'thankyou_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Thank-you Text') ,
|
||||
'description' => 'text and html allowed. displayed above result on success page',
|
||||
'rows' => 8,
|
||||
'cols' => 60,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'RichTextEditor',
|
||||
) ,
|
||||
) ,
|
||||
'thankyou_footer' => array(
|
||||
'name' => 'thankyou_footer',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Thank-you Footer') ,
|
||||
'description' => 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.',
|
||||
'rows' => 8,
|
||||
'cols' => 60,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'RichTextEditor',
|
||||
) ,
|
||||
) ,
|
||||
'is_email_receipt' => array(
|
||||
'name' => 'is_email_receipt',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Send email Receipt') ,
|
||||
'description' => 'if true, receipt is automatically emailed to contact on success',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'receipt_from_name' => array(
|
||||
'name' => 'receipt_from_name',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Receipt From') ,
|
||||
'description' => 'FROM email name used for receipts generated by contributions to this contribution page.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'receipt_from_email' => array(
|
||||
'name' => 'receipt_from_email',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Receipt From email') ,
|
||||
'description' => 'FROM email address used for receipts generated by contributions to this contribution page.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'cc_receipt' => array(
|
||||
'name' => 'cc_receipt',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Receipt cc') ,
|
||||
'description' => 'comma-separated list of email addresses to cc each time a receipt is sent',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'bcc_receipt' => array(
|
||||
'name' => 'bcc_receipt',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Receipt bcc') ,
|
||||
'description' => 'comma-separated list of email addresses to bcc each time a receipt is sent',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'receipt_text' => array(
|
||||
'name' => 'receipt_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Receipt Text') ,
|
||||
'description' => 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
|
||||
'rows' => 6,
|
||||
'cols' => 50,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'TextArea',
|
||||
) ,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Page Active?') ,
|
||||
'description' => 'Is this property active?',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'footer_text' => array(
|
||||
'name' => 'footer_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Footer Text') ,
|
||||
'description' => 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.',
|
||||
'rows' => 6,
|
||||
'cols' => 50,
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 1,
|
||||
'html' => array(
|
||||
'type' => 'RichTextEditor',
|
||||
) ,
|
||||
) ,
|
||||
'amount_block_is_active' => array(
|
||||
'name' => 'amount_block_is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Amount Block Active?') ,
|
||||
'description' => 'Is this property active?',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'start_date' => array(
|
||||
'name' => 'start_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Contribution Page Start Date') ,
|
||||
'description' => 'Date and time that this page starts.',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'end_date' => array(
|
||||
'name' => 'end_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Contribution Page End Date') ,
|
||||
'description' => 'Date and time that this page ends. May be NULL if no defined end date/time',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'created_id' => array(
|
||||
'name' => 'created_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Page Created By') ,
|
||||
'description' => 'FK to civicrm_contact, who created this contribution page',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'created_date' => array(
|
||||
'name' => 'created_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Contribution Page Created Date') ,
|
||||
'description' => 'Date and time that contribution page was created.',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'currency' => array(
|
||||
'name' => 'currency',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Contribution Page Currency') ,
|
||||
'description' => '3 character string, value from config setting or input via user.',
|
||||
'maxlength' => 3,
|
||||
'size' => CRM_Utils_Type::FOUR,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_currency',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'full_name',
|
||||
'nameColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'campaign_id' => array(
|
||||
'name' => 'campaign_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Page Campaign ID') ,
|
||||
'description' => 'The campaign for which we are collecting contributions with this page.',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_campaign',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'is_share' => array(
|
||||
'name' => 'is_share',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Contribution Page Shared?') ,
|
||||
'description' => 'Can people share the contribution page through social media?',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_billing_required' => array(
|
||||
'name' => 'is_billing_required',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is billing block required') ,
|
||||
'description' => 'if true - billing block is required for online contribution page',
|
||||
'table_name' => 'civicrm_contribution_page',
|
||||
'entity' => 'ContributionPage',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionPage',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_page', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_page', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,328 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/ContributionProduct.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:8ef29c5c92b3ffb2a678bd4c585a3d0e)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_ContributionProduct constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_ContributionProduct extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contribution_product';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $product_id;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_id;
|
||||
/**
|
||||
* Option value selected if applicable - e.g. color, size etc.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $product_option;
|
||||
/**
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $quantity;
|
||||
/**
|
||||
* Optional. Can be used to record the date this product was fulfilled or shipped.
|
||||
*
|
||||
* @var date
|
||||
*/
|
||||
public $fulfilled_date;
|
||||
/**
|
||||
* Actual start date for a time-delimited premium (subscription, service or membership)
|
||||
*
|
||||
* @var date
|
||||
*/
|
||||
public $start_date;
|
||||
/**
|
||||
* Actual end date for a time-delimited premium (subscription, service or membership)
|
||||
*
|
||||
* @var date
|
||||
*/
|
||||
public $end_date;
|
||||
/**
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $comment;
|
||||
/**
|
||||
* FK to Financial Type(for membership price sets only).
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $financial_type_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contribution_product';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Product ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'product_id' => array(
|
||||
'name' => 'product_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Product ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_id' => array(
|
||||
'name' => 'contribution_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_Contribution',
|
||||
) ,
|
||||
'product_option' => array(
|
||||
'name' => 'product_option',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Product Option') ,
|
||||
'description' => 'Option value selected if applicable - e.g. color, size etc.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution_product.product_option',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'quantity' => array(
|
||||
'name' => 'quantity',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Quantity') ,
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution_product.quantity',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'fulfilled_date' => array(
|
||||
'name' => 'fulfilled_date',
|
||||
'type' => CRM_Utils_Type::T_DATE,
|
||||
'title' => ts('Fulfilled Date') ,
|
||||
'description' => 'Optional. Can be used to record the date this product was fulfilled or shipped.',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution_product.fulfilled_date',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_start_date' => array(
|
||||
'name' => 'start_date',
|
||||
'type' => CRM_Utils_Type::T_DATE,
|
||||
'title' => ts('Start date for premium') ,
|
||||
'description' => 'Actual start date for a time-delimited premium (subscription, service or membership)',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution_product.start_date',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_end_date' => array(
|
||||
'name' => 'end_date',
|
||||
'type' => CRM_Utils_Type::T_DATE,
|
||||
'title' => ts('End date for premium') ,
|
||||
'description' => 'Actual end date for a time-delimited premium (subscription, service or membership)',
|
||||
'export' => true,
|
||||
'where' => 'civicrm_contribution_product.end_date',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'comment' => array(
|
||||
'name' => 'comment',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Premium comment') ,
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'financial_type_id' => array(
|
||||
'name' => 'financial_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Financial Type') ,
|
||||
'description' => 'FK to Financial Type(for membership price sets only).',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_product',
|
||||
'entity' => 'ContributionProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_ContributionProduct',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_FinancialType',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_financial_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_product', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_product', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,761 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:a1007a4585bac4fcb04ce47535aecec0)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_ContributionRecur constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contribution_recur';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Contribution Recur ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Foreign key to civicrm_contact.id .
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* Amount to be contributed or charged each recurrence.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $amount;
|
||||
/**
|
||||
* 3 character string, value from config setting or input via user.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $currency;
|
||||
/**
|
||||
* Time units for recurrence of payment.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $frequency_unit;
|
||||
/**
|
||||
* Number of time units for recurrence of payment.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $frequency_interval;
|
||||
/**
|
||||
* Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $installments;
|
||||
/**
|
||||
* The date the first scheduled recurring contribution occurs.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $start_date;
|
||||
/**
|
||||
* When this recurring contribution record was created.
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $create_date;
|
||||
/**
|
||||
* Last updated date for this record. mostly the last time a payment was received
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $modified_date;
|
||||
/**
|
||||
* Date this recurring contribution was cancelled by contributor- if we can get access to it
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $cancel_date;
|
||||
/**
|
||||
* Date this recurring contribution finished successfully
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $end_date;
|
||||
/**
|
||||
* Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $processor_id;
|
||||
/**
|
||||
* Optionally used to store a link to a payment token used for this recurring contribution.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $payment_token_id;
|
||||
/**
|
||||
* unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $trxn_id;
|
||||
/**
|
||||
* unique invoice id, system generated or passed in
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $invoice_id;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_status_id;
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_test;
|
||||
/**
|
||||
* Day in the period when the payment should be charged e.g. 1st of month, 15th etc.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $cycle_day;
|
||||
/**
|
||||
* Next scheduled date
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $next_sched_contribution_date;
|
||||
/**
|
||||
* Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $failure_count;
|
||||
/**
|
||||
* Date to retry failed attempt
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
public $failure_retry_date;
|
||||
/**
|
||||
* Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $auto_renew;
|
||||
/**
|
||||
* Foreign key to civicrm_payment_processor.id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $payment_processor_id;
|
||||
/**
|
||||
* FK to Financial Type
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $financial_type_id;
|
||||
/**
|
||||
* FK to Payment Instrument
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $payment_instrument_id;
|
||||
/**
|
||||
* The campaign for which this contribution has been triggered.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $campaign_id;
|
||||
/**
|
||||
* if true, receipt is automatically emailed to contact on each successful payment
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_email_receipt;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contribution_recur';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_token_id', 'civicrm_payment_token', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Recurring Contribution ID') ,
|
||||
'description' => 'Contribution Recur ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'Foreign key to civicrm_contact.id .',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'amount' => array(
|
||||
'name' => 'amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Amount') ,
|
||||
'description' => 'Amount to be contributed or charged each recurrence.',
|
||||
'required' => true,
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'currency' => array(
|
||||
'name' => 'currency',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Currency') ,
|
||||
'description' => '3 character string, value from config setting or input via user.',
|
||||
'maxlength' => 3,
|
||||
'size' => CRM_Utils_Type::FOUR,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_currency',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'full_name',
|
||||
'nameColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'frequency_unit' => array(
|
||||
'name' => 'frequency_unit',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Frequency Unit') ,
|
||||
'description' => 'Time units for recurrence of payment.',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'default' => 'month',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'recur_frequency_units',
|
||||
'keyColumn' => 'name',
|
||||
'optionEditPath' => 'civicrm/admin/options/recur_frequency_units',
|
||||
)
|
||||
) ,
|
||||
'frequency_interval' => array(
|
||||
'name' => 'frequency_interval',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Interval (number of units)') ,
|
||||
'description' => 'Number of time units for recurrence of payment.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'installments' => array(
|
||||
'name' => 'installments',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Number of Installments') ,
|
||||
'description' => 'Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'start_date' => array(
|
||||
'name' => 'start_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Recurring Contribution Started Date') ,
|
||||
'description' => 'The date the first scheduled recurring contribution occurs.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'create_date' => array(
|
||||
'name' => 'create_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Recurring Contribution Created Date') ,
|
||||
'description' => 'When this recurring contribution record was created.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'modified_date' => array(
|
||||
'name' => 'modified_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Recurring Contribution Modified Date') ,
|
||||
'description' => 'Last updated date for this record. mostly the last time a payment was received',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'cancel_date' => array(
|
||||
'name' => 'cancel_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Recurring Contribution Cancel Date') ,
|
||||
'description' => 'Date this recurring contribution was cancelled by contributor- if we can get access to it',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'end_date' => array(
|
||||
'name' => 'end_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Recurring Contribution End Date') ,
|
||||
'description' => 'Date this recurring contribution finished successfully',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'processor_id' => array(
|
||||
'name' => 'processor_id',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Processor ID') ,
|
||||
'description' => 'Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'payment_token_id' => array(
|
||||
'name' => 'payment_token_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Payment Token ID') ,
|
||||
'description' => 'Optionally used to store a link to a payment token used for this recurring contribution.',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_PaymentToken',
|
||||
) ,
|
||||
'trxn_id' => array(
|
||||
'name' => 'trxn_id',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Transaction ID') ,
|
||||
'description' => 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'invoice_id' => array(
|
||||
'name' => 'invoice_id',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Invoice ID') ,
|
||||
'description' => 'unique invoice id, system generated or passed in',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_status_id' => array(
|
||||
'name' => 'contribution_status_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Recurring Contribution Status') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution_recur.contribution_status_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'contribution_status',
|
||||
'optionEditPath' => 'civicrm/admin/options/contribution_status',
|
||||
)
|
||||
) ,
|
||||
'is_test' => array(
|
||||
'name' => 'is_test',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Test') ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution_recur.is_test',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'cycle_day' => array(
|
||||
'name' => 'cycle_day',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Number of Cycle Day') ,
|
||||
'description' => 'Day in the period when the payment should be charged e.g. 1st of month, 15th etc.',
|
||||
'required' => true,
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'next_sched_contribution_date' => array(
|
||||
'name' => 'next_sched_contribution_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Next Scheduled Contribution Date') ,
|
||||
'description' => 'Next scheduled date',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'failure_count' => array(
|
||||
'name' => 'failure_count',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Number of Failures') ,
|
||||
'description' => 'Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Text',
|
||||
) ,
|
||||
) ,
|
||||
'failure_retry_date' => array(
|
||||
'name' => 'failure_retry_date',
|
||||
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
|
||||
'title' => ts('Retry Failed Attempt Date') ,
|
||||
'description' => 'Date to retry failed attempt',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select Date',
|
||||
) ,
|
||||
) ,
|
||||
'auto_renew' => array(
|
||||
'name' => 'auto_renew',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Auto Renew') ,
|
||||
'description' => 'Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
'payment_processor_id' => array(
|
||||
'name' => 'payment_processor_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Payment Processor') ,
|
||||
'description' => 'Foreign key to civicrm_payment_processor.id',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
|
||||
) ,
|
||||
'financial_type_id' => array(
|
||||
'name' => 'financial_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Financial Type') ,
|
||||
'description' => 'FK to Financial Type',
|
||||
'export' => false,
|
||||
'where' => 'civicrm_contribution_recur.financial_type_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_FinancialType',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_financial_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'payment_instrument_id' => array(
|
||||
'name' => 'payment_instrument_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Payment Method') ,
|
||||
'description' => 'FK to Payment Instrument',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'payment_instrument',
|
||||
'optionEditPath' => 'civicrm/admin/options/payment_instrument',
|
||||
)
|
||||
) ,
|
||||
'contribution_campaign_id' => array(
|
||||
'name' => 'campaign_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Campaign') ,
|
||||
'description' => 'The campaign for which this contribution has been triggered.',
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution_recur.campaign_id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_campaign',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'is_email_receipt' => array(
|
||||
'name' => 'is_email_receipt',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Send email Receipt?') ,
|
||||
'description' => 'if true, receipt is automatically emailed to contact on each successful payment',
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_contribution_recur',
|
||||
'entity' => 'ContributionRecur',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'CheckBox',
|
||||
) ,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_recur', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_recur', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'UI_contrib_trxn_id' => array(
|
||||
'name' => 'UI_contrib_trxn_id',
|
||||
'field' => array(
|
||||
0 => 'trxn_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_contribution_recur::1::trxn_id',
|
||||
) ,
|
||||
'UI_contrib_invoice_id' => array(
|
||||
'name' => 'UI_contrib_invoice_id',
|
||||
'field' => array(
|
||||
0 => 'invoice_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'unique' => true,
|
||||
'sig' => 'civicrm_contribution_recur::1::invoice_id',
|
||||
) ,
|
||||
'index_contribution_status' => array(
|
||||
'name' => 'index_contribution_status',
|
||||
'field' => array(
|
||||
0 => 'contribution_status_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution_recur::0::contribution_status_id',
|
||||
) ,
|
||||
'UI_contribution_recur_payment_instrument_id' => array(
|
||||
'name' => 'UI_contribution_recur_payment_instrument_id',
|
||||
'field' => array(
|
||||
0 => 'payment_instrument_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution_recur::0::payment_instrument_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,364 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/ContributionSoft.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:eb1e493dc7ff4da34167ad0828d61fd4)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_ContributionSoft constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_ContributionSoft extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contribution_soft';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Soft Contribution ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* FK to contribution table.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_id;
|
||||
/**
|
||||
* FK to Contact ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contact_id;
|
||||
/**
|
||||
* Amount of this soft contribution.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $amount;
|
||||
/**
|
||||
* 3 character string, value from config setting or input via user.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $currency;
|
||||
/**
|
||||
* FK to civicrm_pcp.id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $pcp_id;
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $pcp_display_in_roll;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $pcp_roll_nickname;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $pcp_personal_note;
|
||||
/**
|
||||
* Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $soft_credit_type_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contribution_soft';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'pcp_id', 'civicrm_pcp', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'contribution_soft_id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Soft Contribution ID') ,
|
||||
'description' => 'Soft Contribution ID',
|
||||
'required' => true,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution_soft.id',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_id' => array(
|
||||
'name' => 'contribution_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Soft Contribution - Contribution') ,
|
||||
'description' => 'FK to contribution table.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_Contribution',
|
||||
) ,
|
||||
'contribution_soft_contact_id' => array(
|
||||
'name' => 'contact_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contact ID') ,
|
||||
'description' => 'FK to Contact ID',
|
||||
'required' => true,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution_soft.contact_id',
|
||||
'headerPattern' => '/contact(.?id)?/i',
|
||||
'dataPattern' => '/^\d+$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
||||
) ,
|
||||
'amount' => array(
|
||||
'name' => 'amount',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Soft Contribution Amount') ,
|
||||
'description' => 'Amount of this soft contribution.',
|
||||
'required' => true,
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'import' => true,
|
||||
'where' => 'civicrm_contribution_soft.amount',
|
||||
'headerPattern' => '/total(.?am(ou)?nt)?/i',
|
||||
'dataPattern' => '/^\d+(\.\d{2})?$/',
|
||||
'export' => true,
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'currency' => array(
|
||||
'name' => 'currency',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Soft Contribution Currency') ,
|
||||
'description' => '3 character string, value from config setting or input via user.',
|
||||
'maxlength' => 3,
|
||||
'size' => CRM_Utils_Type::FOUR,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_currency',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'full_name',
|
||||
'nameColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'pcp_id' => array(
|
||||
'name' => 'pcp_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Soft Contribution PCP') ,
|
||||
'description' => 'FK to civicrm_pcp.id',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_PCP_DAO_PCP',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_pcp',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'title',
|
||||
)
|
||||
) ,
|
||||
'pcp_display_in_roll' => array(
|
||||
'name' => 'pcp_display_in_roll',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Soft Contribution Display on PCP') ,
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'pcp_roll_nickname' => array(
|
||||
'name' => 'pcp_roll_nickname',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Soft Contribution PCP Nickname') ,
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'pcp_personal_note' => array(
|
||||
'name' => 'pcp_personal_note',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Soft Contribution PCP Note') ,
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'soft_credit_type_id' => array(
|
||||
'name' => 'soft_credit_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Soft Credit Type') ,
|
||||
'description' => 'Soft Credit Type ID.Implicit FK to civicrm_option_value where option_group = soft_credit_type.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_contribution_soft',
|
||||
'entity' => 'ContributionSoft',
|
||||
'bao' => 'CRM_Contribute_BAO_ContributionSoft',
|
||||
'localizable' => 0,
|
||||
'pseudoconstant' => array(
|
||||
'optionGroupName' => 'soft_credit_type',
|
||||
'optionEditPath' => 'civicrm/admin/options/soft_credit_type',
|
||||
)
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_soft', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_soft', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array(
|
||||
'index_id' => array(
|
||||
'name' => 'index_id',
|
||||
'field' => array(
|
||||
0 => 'pcp_id',
|
||||
) ,
|
||||
'localizable' => false,
|
||||
'sig' => 'civicrm_contribution_soft::0::pcp_id',
|
||||
) ,
|
||||
);
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
330
sites/all/modules/civicrm/CRM/Contribute/DAO/Premium.php
Normal file
330
sites/all/modules/civicrm/CRM/Contribute/DAO/Premium.php
Normal file
|
@ -0,0 +1,330 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/Premium.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:86a5118380bd35cee851da735f699ac2)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_Premium constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_premiums';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Joins these premium settings to another object. Always civicrm_contribution_page for now.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $entity_table;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $entity_id;
|
||||
/**
|
||||
* Is the Premiums feature enabled for this page?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $premiums_active;
|
||||
/**
|
||||
* Title for Premiums section.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $premiums_intro_title;
|
||||
/**
|
||||
* Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $premiums_intro_text;
|
||||
/**
|
||||
* This email address is included in receipts if it is populated and a premium has been selected.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $premiums_contact_email;
|
||||
/**
|
||||
* This phone number is included in receipts if it is populated and a premium has been selected.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $premiums_contact_phone;
|
||||
/**
|
||||
* Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $premiums_display_min_contribution;
|
||||
/**
|
||||
* Label displayed for No Thank-you option in premiums block (e.g. No thank you)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $premiums_nothankyou_label;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $premiums_nothankyou_position;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_premiums';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Premium ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'entity_table' => array(
|
||||
'name' => 'entity_table',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Premium Entity') ,
|
||||
'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
|
||||
'required' => true,
|
||||
'maxlength' => 64,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'entity_id' => array(
|
||||
'name' => 'entity_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Premium entity ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'premiums_active' => array(
|
||||
'name' => 'premiums_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Premium Active?') ,
|
||||
'description' => 'Is the Premiums feature enabled for this page?',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'premiums_intro_title' => array(
|
||||
'name' => 'premiums_intro_title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Title for Premiums section') ,
|
||||
'description' => 'Title for Premiums section.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'premiums_intro_text' => array(
|
||||
'name' => 'premiums_intro_text',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Premium Introductory Text') ,
|
||||
'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'premiums_contact_email' => array(
|
||||
'name' => 'premiums_contact_email',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Premium Contact Email') ,
|
||||
'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
|
||||
'maxlength' => 100,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'premiums_contact_phone' => array(
|
||||
'name' => 'premiums_contact_phone',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Premiums Contact Phone') ,
|
||||
'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
|
||||
'maxlength' => 50,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'premiums_display_min_contribution' => array(
|
||||
'name' => 'premiums_display_min_contribution',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Display Minimum Contribution?') ,
|
||||
'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'premiums_nothankyou_label' => array(
|
||||
'name' => 'premiums_nothankyou_label',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('No Thank-you Text') ,
|
||||
'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'premiums_nothankyou_position' => array(
|
||||
'name' => 'premiums_nothankyou_position',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('No Thank-you Position') ,
|
||||
'default' => '1',
|
||||
'table_name' => 'civicrm_premiums',
|
||||
'entity' => 'Premium',
|
||||
'bao' => 'CRM_Contribute_BAO_Premium',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'premiums', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'premiums', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
237
sites/all/modules/civicrm/CRM/Contribute/DAO/PremiumsProduct.php
Normal file
237
sites/all/modules/civicrm/CRM/Contribute/DAO/PremiumsProduct.php
Normal file
|
@ -0,0 +1,237 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:6c90561115f3fbe406af545ef055f79c)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_PremiumsProduct constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_premiums_product';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Contribution ID
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Foreign key to premiums settings record.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $premiums_id;
|
||||
/**
|
||||
* Foreign key to each product object.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $product_id;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $weight;
|
||||
/**
|
||||
* FK to Financial Type.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $financial_type_id;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_premiums_product';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'premiums_id', 'civicrm_premiums', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'product_id', 'civicrm_product', 'id');
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Premium Product ID') ,
|
||||
'description' => 'Contribution ID',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums_product',
|
||||
'entity' => 'PremiumsProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_PremiumsProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'premiums_id' => array(
|
||||
'name' => 'premiums_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Premium') ,
|
||||
'description' => 'Foreign key to premiums settings record.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums_product',
|
||||
'entity' => 'PremiumsProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_PremiumsProduct',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_Premium',
|
||||
) ,
|
||||
'product_id' => array(
|
||||
'name' => 'product_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Product') ,
|
||||
'description' => 'Foreign key to each product object.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums_product',
|
||||
'entity' => 'PremiumsProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_PremiumsProduct',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_Product',
|
||||
) ,
|
||||
'weight' => array(
|
||||
'name' => 'weight',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Order') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_premiums_product',
|
||||
'entity' => 'PremiumsProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_PremiumsProduct',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'financial_type_id' => array(
|
||||
'name' => 'financial_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Financial Type') ,
|
||||
'description' => 'FK to Financial Type.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_premiums_product',
|
||||
'entity' => 'PremiumsProduct',
|
||||
'bao' => 'CRM_Contribute_DAO_PremiumsProduct',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_FinancialType',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_financial_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'premiums_product', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'premiums_product', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
524
sites/all/modules/civicrm/CRM/Contribute/DAO/Product.php
Normal file
524
sites/all/modules/civicrm/CRM/Contribute/DAO/Product.php
Normal file
|
@ -0,0 +1,524 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/Product.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:81e315b903d403508f379dc9c0fcf532)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_Product constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_Product extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_product';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* Required product/premium name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* Optional description of the product/premium.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* Optional product sku or code.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $sku;
|
||||
/**
|
||||
* Store comma-delimited list of color, size, etc. options for the product.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $options;
|
||||
/**
|
||||
* Full or relative URL to uploaded image - fullsize.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $image;
|
||||
/**
|
||||
* Full or relative URL to image thumbnail.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $thumbnail;
|
||||
/**
|
||||
* Sell price or market value for premiums. For tax-deductible contributions, this will be stored as non_deductible_amount in the contribution record.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $price;
|
||||
/**
|
||||
* 3 character string, value from config setting or input via user.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $currency;
|
||||
/**
|
||||
* FK to Financial Type.
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $financial_type_id;
|
||||
/**
|
||||
* Minimum contribution required to be eligible to select this premium.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $min_contribution;
|
||||
/**
|
||||
* Actual cost of this product. Useful to determine net return from sale or using this as an incentive.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $cost;
|
||||
/**
|
||||
* Disabling premium removes it from the premiums_premium join table below.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Rolling means we set start/end based on current day, fixed means we set start/end for current year or month
|
||||
(e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $period_type;
|
||||
/**
|
||||
* Month and day (MMDD) that fixed period type subscription or membership starts.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $fixed_period_start_day;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $duration_unit;
|
||||
/**
|
||||
* Number of units for total duration of subscription, service, membership (e.g. 12 Months).
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $duration_interval;
|
||||
/**
|
||||
* Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $frequency_unit;
|
||||
/**
|
||||
* Number of units for delivery frequency of subscription, service, membership (e.g. every 3 Months).
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $frequency_interval;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_product';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Product ID') ,
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'product_name' => array(
|
||||
'name' => 'name',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Product Name') ,
|
||||
'description' => 'Required product/premium name',
|
||||
'required' => true,
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'export' => true,
|
||||
'where' => 'civicrm_product.name',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Description') ,
|
||||
'description' => 'Optional description of the product/premium.',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'sku' => array(
|
||||
'name' => 'sku',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('SKU') ,
|
||||
'description' => 'Optional product sku or code.',
|
||||
'maxlength' => 50,
|
||||
'size' => CRM_Utils_Type::BIG,
|
||||
'export' => true,
|
||||
'where' => 'civicrm_product.sku',
|
||||
'headerPattern' => '',
|
||||
'dataPattern' => '',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'options' => array(
|
||||
'name' => 'options',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Options') ,
|
||||
'description' => 'Store comma-delimited list of color, size, etc. options for the product.',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 1,
|
||||
) ,
|
||||
'image' => array(
|
||||
'name' => 'image',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Image') ,
|
||||
'description' => 'Full or relative URL to uploaded image - fullsize.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'thumbnail' => array(
|
||||
'name' => 'thumbnail',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Thumbnail') ,
|
||||
'description' => 'Full or relative URL to image thumbnail.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'price' => array(
|
||||
'name' => 'price',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Price') ,
|
||||
'description' => 'Sell price or market value for premiums. For tax-deductible contributions, this will be stored as non_deductible_amount in the contribution record.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'currency' => array(
|
||||
'name' => 'currency',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Currency') ,
|
||||
'description' => '3 character string, value from config setting or input via user.',
|
||||
'maxlength' => 3,
|
||||
'size' => CRM_Utils_Type::FOUR,
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_currency',
|
||||
'keyColumn' => 'name',
|
||||
'labelColumn' => 'full_name',
|
||||
'nameColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'financial_type_id' => array(
|
||||
'name' => 'financial_type_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Financial Type') ,
|
||||
'description' => 'FK to Financial Type.',
|
||||
'default' => 'NULL',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Financial_DAO_FinancialType',
|
||||
'pseudoconstant' => array(
|
||||
'table' => 'civicrm_financial_type',
|
||||
'keyColumn' => 'id',
|
||||
'labelColumn' => 'name',
|
||||
)
|
||||
) ,
|
||||
'min_contribution' => array(
|
||||
'name' => 'min_contribution',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Minimum Contribution') ,
|
||||
'description' => 'Minimum contribution required to be eligible to select this premium.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'cost' => array(
|
||||
'name' => 'cost',
|
||||
'type' => CRM_Utils_Type::T_MONEY,
|
||||
'title' => ts('Cost') ,
|
||||
'description' => 'Actual cost of this product. Useful to determine net return from sale or using this as an incentive.',
|
||||
'precision' => array(
|
||||
20,
|
||||
2
|
||||
) ,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Is Active') ,
|
||||
'description' => 'Disabling premium removes it from the premiums_premium join table below.',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'period_type' => array(
|
||||
'name' => 'period_type',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Period Type') ,
|
||||
'description' => 'Rolling means we set start/end based on current day, fixed means we set start/end for current year or month
|
||||
(e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) ',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'default' => 'rolling',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::periodType',
|
||||
)
|
||||
) ,
|
||||
'fixed_period_start_day' => array(
|
||||
'name' => 'fixed_period_start_day',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Fixed Period Start Day') ,
|
||||
'description' => 'Month and day (MMDD) that fixed period type subscription or membership starts.',
|
||||
'default' => '0101',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'duration_unit' => array(
|
||||
'name' => 'duration_unit',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Duration Unit') ,
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'default' => 'year',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::getPremiumUnits',
|
||||
)
|
||||
) ,
|
||||
'duration_interval' => array(
|
||||
'name' => 'duration_interval',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Duration Interval') ,
|
||||
'description' => 'Number of units for total duration of subscription, service, membership (e.g. 12 Months).',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'frequency_unit' => array(
|
||||
'name' => 'frequency_unit',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Frequency Unit') ,
|
||||
'description' => 'Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.',
|
||||
'maxlength' => 8,
|
||||
'size' => CRM_Utils_Type::EIGHT,
|
||||
'default' => 'month',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
'html' => array(
|
||||
'type' => 'Select',
|
||||
) ,
|
||||
'pseudoconstant' => array(
|
||||
'callback' => 'CRM_Core_SelectValues::getPremiumUnits',
|
||||
)
|
||||
) ,
|
||||
'frequency_interval' => array(
|
||||
'name' => 'frequency_interval',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Frequency Interval') ,
|
||||
'description' => 'Number of units for delivery frequency of subscription, service, membership (e.g. every 3 Months).',
|
||||
'table_name' => 'civicrm_product',
|
||||
'entity' => 'Product',
|
||||
'bao' => 'CRM_Contribute_DAO_Product',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'product', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'product', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
426
sites/all/modules/civicrm/CRM/Contribute/DAO/Widget.php
Normal file
426
sites/all/modules/civicrm/CRM/Contribute/DAO/Widget.php
Normal file
|
@ -0,0 +1,426 @@
|
|||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*/
|
||||
/**
|
||||
* @package CRM
|
||||
* @copyright CiviCRM LLC (c) 2004-2017
|
||||
*
|
||||
* Generated from xml/schema/CRM/Contribute/Widget.xml
|
||||
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
||||
* (GenCodeChecksum:b47ae223e6fd74db68394139a309be31)
|
||||
*/
|
||||
require_once 'CRM/Core/DAO.php';
|
||||
require_once 'CRM/Utils/Type.php';
|
||||
/**
|
||||
* CRM_Contribute_DAO_Widget constructor.
|
||||
*/
|
||||
class CRM_Contribute_DAO_Widget extends CRM_Core_DAO {
|
||||
/**
|
||||
* Static instance to hold the table name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
static $_tableName = 'civicrm_contribution_widget';
|
||||
/**
|
||||
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
static $_log = true;
|
||||
/**
|
||||
* Contribution Id
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* The Contribution Page which triggered this contribution
|
||||
*
|
||||
* @var int unsigned
|
||||
*/
|
||||
public $contribution_page_id;
|
||||
/**
|
||||
* Is this property active?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* Widget title.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* URL to Widget logo
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $url_logo;
|
||||
/**
|
||||
* Button title.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $button_title;
|
||||
/**
|
||||
* About description.
|
||||
*
|
||||
* @var text
|
||||
*/
|
||||
public $about;
|
||||
/**
|
||||
* URL to Homepage.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $url_homepage;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_title;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_button;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_bar;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_main_text;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_main;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_main_bg;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_bg;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_about_link;
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $color_homepage_link;
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->__table = 'civicrm_contribution_widget';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Returns foreign keys and entity references.
|
||||
*
|
||||
* @return array
|
||||
* [CRM_Core_Reference_Interface]
|
||||
*/
|
||||
static function getReferenceColumns() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['links'])) {
|
||||
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
|
||||
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id');
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['links'];
|
||||
}
|
||||
/**
|
||||
* Returns all the column names of this table
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &fields() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
||||
Civi::$statics[__CLASS__]['fields'] = array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Widget ID') ,
|
||||
'description' => 'Contribution Id',
|
||||
'required' => true,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'contribution_page_id' => array(
|
||||
'name' => 'contribution_page_id',
|
||||
'type' => CRM_Utils_Type::T_INT,
|
||||
'title' => ts('Contribution Page') ,
|
||||
'description' => 'The Contribution Page which triggered this contribution',
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
|
||||
) ,
|
||||
'is_active' => array(
|
||||
'name' => 'is_active',
|
||||
'type' => CRM_Utils_Type::T_BOOLEAN,
|
||||
'title' => ts('Enabled?') ,
|
||||
'description' => 'Is this property active?',
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'title' => array(
|
||||
'name' => 'title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Widget Title') ,
|
||||
'description' => 'Widget title.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'url_logo' => array(
|
||||
'name' => 'url_logo',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Widget Image Url') ,
|
||||
'description' => 'URL to Widget logo',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'button_title' => array(
|
||||
'name' => 'button_title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Button Title') ,
|
||||
'description' => 'Button title.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'about' => array(
|
||||
'name' => 'about',
|
||||
'type' => CRM_Utils_Type::T_TEXT,
|
||||
'title' => ts('Description') ,
|
||||
'description' => 'About description.',
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'url_homepage' => array(
|
||||
'name' => 'url_homepage',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Homepage Url') ,
|
||||
'description' => 'URL to Homepage.',
|
||||
'maxlength' => 255,
|
||||
'size' => CRM_Utils_Type::HUGE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_title' => array(
|
||||
'name' => 'color_title',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Title Color') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_button' => array(
|
||||
'name' => 'color_button',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Button Colour') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_bar' => array(
|
||||
'name' => 'color_bar',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Bar Color') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_main_text' => array(
|
||||
'name' => 'color_main_text',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Main Text Color') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_main' => array(
|
||||
'name' => 'color_main',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Main Colour') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_main_bg' => array(
|
||||
'name' => 'color_main_bg',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Backgroup Color') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_bg' => array(
|
||||
'name' => 'color_bg',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Other Backgroun Colour') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_about_link' => array(
|
||||
'name' => 'color_about_link',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('About Link Colour') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
'color_homepage_link' => array(
|
||||
'name' => 'color_homepage_link',
|
||||
'type' => CRM_Utils_Type::T_STRING,
|
||||
'title' => ts('Homepage Link Colour') ,
|
||||
'maxlength' => 10,
|
||||
'size' => CRM_Utils_Type::TWELVE,
|
||||
'table_name' => 'civicrm_contribution_widget',
|
||||
'entity' => 'Widget',
|
||||
'bao' => 'CRM_Contribute_BAO_Widget',
|
||||
'localizable' => 0,
|
||||
) ,
|
||||
);
|
||||
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fields'];
|
||||
}
|
||||
/**
|
||||
* Return a mapping from field-name to the corresponding key (as used in fields()).
|
||||
*
|
||||
* @return array
|
||||
* Array(string $name => string $uniqueName).
|
||||
*/
|
||||
static function &fieldKeys() {
|
||||
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
|
||||
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
|
||||
}
|
||||
return Civi::$statics[__CLASS__]['fieldKeys'];
|
||||
}
|
||||
/**
|
||||
* Returns the names of this table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function getTableName() {
|
||||
return self::$_tableName;
|
||||
}
|
||||
/**
|
||||
* Returns if this table needs to be logged
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getLog() {
|
||||
return self::$_log;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be imported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &import($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_widget', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of fields that can be exported
|
||||
*
|
||||
* @param bool $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
static function &export($prefix = false) {
|
||||
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_widget', $prefix, array());
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Returns the list of indices
|
||||
*/
|
||||
public static function indices($localize = TRUE) {
|
||||
$indices = array();
|
||||
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue