3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Contribute/ContributionProduct.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c40733f5ba2ac9d433e25758534a7f2e)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_ContributionProduct
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_contribution_product';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
65 public $contribution_id;
67 * Option value selected if applicable - e.g. color, size etc.
71 public $product_option;
78 * Optional. Can be used to record the date this product was fulfilled or shipped.
82 public $fulfilled_date;
84 * Actual start date for a time-delimited premium (subscription, service or membership)
90 * Actual end date for a time-delimited premium (subscription, service or membership)
101 * FK to Financial Type(for membership price sets only).
105 public $financial_type_id;
109 * @return civicrm_contribution_product
111 function __construct() {
112 $this->__table
= 'civicrm_contribution_product';
113 parent
::__construct();
116 * Returns foreign keys and entity references
119 * [CRM_Core_Reference_Interface]
121 static function getReferenceColumns() {
122 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
123 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
124 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contribution_id', 'civicrm_contribution', 'id');
125 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
126 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
128 return Civi
::$statics[__CLASS__
]['links'];
131 * Returns all the column names of this table
135 static function &fields() {
136 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
137 Civi
::$statics[__CLASS__
]['fields'] = array(
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Contribution Product ID') ,
144 'product_id' => array(
145 'name' => 'product_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Product ID') ,
150 'contribution_id' => array(
151 'name' => 'contribution_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Contribution ID') ,
155 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
157 'product_option' => array(
158 'name' => 'product_option',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Product Option') ,
161 'description' => 'Option value selected if applicable - e.g. color, size etc.',
163 'size' => CRM_Utils_Type
::HUGE
,
165 'where' => 'civicrm_contribution_product.product_option',
166 'headerPattern' => '',
170 'name' => 'quantity',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Quantity') ,
174 'where' => 'civicrm_contribution_product.quantity',
175 'headerPattern' => '',
178 'fulfilled_date' => array(
179 'name' => 'fulfilled_date',
180 'type' => CRM_Utils_Type
::T_DATE
,
181 'title' => ts('Fulfilled Date') ,
182 'description' => 'Optional. Can be used to record the date this product was fulfilled or shipped.',
184 'where' => 'civicrm_contribution_product.fulfilled_date',
185 'headerPattern' => '',
188 'contribution_start_date' => array(
189 'name' => 'start_date',
190 'type' => CRM_Utils_Type
::T_DATE
,
191 'title' => ts('Start date for premium') ,
192 'description' => 'Actual start date for a time-delimited premium (subscription, service or membership)',
194 'where' => 'civicrm_contribution_product.start_date',
195 'headerPattern' => '',
198 'contribution_end_date' => array(
199 'name' => 'end_date',
200 'type' => CRM_Utils_Type
::T_DATE
,
201 'title' => ts('End date for premium') ,
202 'description' => 'Actual end date for a time-delimited premium (subscription, service or membership)',
204 'where' => 'civicrm_contribution_product.end_date',
205 'headerPattern' => '',
210 'type' => CRM_Utils_Type
::T_TEXT
,
211 'title' => ts('Premium comment') ,
213 'financial_type_id' => array(
214 'name' => 'financial_type_id',
215 'type' => CRM_Utils_Type
::T_INT
,
216 'title' => ts('Financial Type') ,
217 'description' => 'FK to Financial Type(for membership price sets only).',
219 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
220 'pseudoconstant' => array(
221 'table' => 'civicrm_financial_type',
223 'labelColumn' => 'name',
227 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
229 return Civi
::$statics[__CLASS__
]['fields'];
232 * Return a mapping from field-name to the corresponding key (as used in fields()).
235 * Array(string $name => string $uniqueName).
237 static function &fieldKeys() {
238 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
239 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
241 return Civi
::$statics[__CLASS__
]['fieldKeys'];
244 * Returns the names of this table
248 static function getTableName() {
249 return self
::$_tableName;
252 * Returns if this table needs to be logged
260 * Returns the list of fields that can be imported
262 * @param bool $prefix
266 static function &import($prefix = false) {
267 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_product', $prefix, array());
271 * Returns the list of fields that can be exported
273 * @param bool $prefix
277 static function &export($prefix = false) {
278 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_product', $prefix, array());