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:79de7abf1bfa670fa9cf3d43e6818bc9)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Contribute_DAO_ContributionProduct constructor.
40 class CRM_Contribute_DAO_ContributionProduct
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_contribution_product';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
67 public $contribution_id;
69 * Option value selected if applicable - e.g. color, size etc.
73 public $product_option;
80 * Optional. Can be used to record the date this product was fulfilled or shipped.
84 public $fulfilled_date;
86 * Actual start date for a time-delimited premium (subscription, service or membership)
92 * Actual end date for a time-delimited premium (subscription, service or membership)
103 * FK to Financial Type(for membership price sets only).
107 public $financial_type_id;
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') ,
143 'table_name' => 'civicrm_contribution_product',
144 'entity' => 'ContributionProduct',
145 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
147 'product_id' => array(
148 'name' => 'product_id',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Product ID') ,
152 'table_name' => 'civicrm_contribution_product',
153 'entity' => 'ContributionProduct',
154 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
156 'contribution_id' => array(
157 'name' => 'contribution_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Contribution ID') ,
161 'table_name' => 'civicrm_contribution_product',
162 'entity' => 'ContributionProduct',
163 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
164 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
166 'product_option' => array(
167 'name' => 'product_option',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Product Option') ,
170 'description' => 'Option value selected if applicable - e.g. color, size etc.',
172 'size' => CRM_Utils_Type
::HUGE
,
174 'where' => 'civicrm_contribution_product.product_option',
175 'headerPattern' => '',
177 'table_name' => 'civicrm_contribution_product',
178 'entity' => 'ContributionProduct',
179 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
182 'name' => 'quantity',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Quantity') ,
186 'where' => 'civicrm_contribution_product.quantity',
187 'headerPattern' => '',
189 'table_name' => 'civicrm_contribution_product',
190 'entity' => 'ContributionProduct',
191 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
193 'fulfilled_date' => array(
194 'name' => 'fulfilled_date',
195 'type' => CRM_Utils_Type
::T_DATE
,
196 'title' => ts('Fulfilled Date') ,
197 'description' => 'Optional. Can be used to record the date this product was fulfilled or shipped.',
199 'where' => 'civicrm_contribution_product.fulfilled_date',
200 'headerPattern' => '',
202 'table_name' => 'civicrm_contribution_product',
203 'entity' => 'ContributionProduct',
204 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
206 'contribution_start_date' => array(
207 'name' => 'start_date',
208 'type' => CRM_Utils_Type
::T_DATE
,
209 'title' => ts('Start date for premium') ,
210 'description' => 'Actual start date for a time-delimited premium (subscription, service or membership)',
212 'where' => 'civicrm_contribution_product.start_date',
213 'headerPattern' => '',
215 'table_name' => 'civicrm_contribution_product',
216 'entity' => 'ContributionProduct',
217 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
219 'contribution_end_date' => array(
220 'name' => 'end_date',
221 'type' => CRM_Utils_Type
::T_DATE
,
222 'title' => ts('End date for premium') ,
223 'description' => 'Actual end date for a time-delimited premium (subscription, service or membership)',
225 'where' => 'civicrm_contribution_product.end_date',
226 'headerPattern' => '',
228 'table_name' => 'civicrm_contribution_product',
229 'entity' => 'ContributionProduct',
230 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
234 'type' => CRM_Utils_Type
::T_TEXT
,
235 'title' => ts('Premium comment') ,
236 'table_name' => 'civicrm_contribution_product',
237 'entity' => 'ContributionProduct',
238 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
240 'financial_type_id' => array(
241 'name' => 'financial_type_id',
242 'type' => CRM_Utils_Type
::T_INT
,
243 'title' => ts('Financial Type') ,
244 'description' => 'FK to Financial Type(for membership price sets only).',
246 'table_name' => 'civicrm_contribution_product',
247 'entity' => 'ContributionProduct',
248 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
249 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
250 'pseudoconstant' => array(
251 'table' => 'civicrm_financial_type',
253 'labelColumn' => 'name',
257 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
259 return Civi
::$statics[__CLASS__
]['fields'];
262 * Return a mapping from field-name to the corresponding key (as used in fields()).
265 * Array(string $name => string $uniqueName).
267 static function &fieldKeys() {
268 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
269 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
271 return Civi
::$statics[__CLASS__
]['fieldKeys'];
274 * Returns the names of this table
278 static function getTableName() {
279 return self
::$_tableName;
282 * Returns if this table needs to be logged
290 * Returns the list of fields that can be imported
292 * @param bool $prefix
296 static function &import($prefix = false) {
297 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_product', $prefix, array());
301 * Returns the list of fields that can be exported
303 * @param bool $prefix
307 static function &export($prefix = false) {
308 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_product', $prefix, array());