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:8ef29c5c92b3ffb2a678bd4c585a3d0e)
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',
148 'product_id' => array(
149 'name' => 'product_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Product ID') ,
153 'table_name' => 'civicrm_contribution_product',
154 'entity' => 'ContributionProduct',
155 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
158 'contribution_id' => array(
159 'name' => 'contribution_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Contribution ID') ,
163 'table_name' => 'civicrm_contribution_product',
164 'entity' => 'ContributionProduct',
165 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
167 'FKClassName' => 'CRM_Contribute_DAO_Contribution',
169 'product_option' => array(
170 'name' => 'product_option',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Product Option') ,
173 'description' => 'Option value selected if applicable - e.g. color, size etc.',
175 'size' => CRM_Utils_Type
::HUGE
,
177 'where' => 'civicrm_contribution_product.product_option',
178 'headerPattern' => '',
180 'table_name' => 'civicrm_contribution_product',
181 'entity' => 'ContributionProduct',
182 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
186 'name' => 'quantity',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'title' => ts('Quantity') ,
190 'where' => 'civicrm_contribution_product.quantity',
191 'headerPattern' => '',
193 'table_name' => 'civicrm_contribution_product',
194 'entity' => 'ContributionProduct',
195 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
198 'fulfilled_date' => array(
199 'name' => 'fulfilled_date',
200 'type' => CRM_Utils_Type
::T_DATE
,
201 'title' => ts('Fulfilled Date') ,
202 'description' => 'Optional. Can be used to record the date this product was fulfilled or shipped.',
204 'where' => 'civicrm_contribution_product.fulfilled_date',
205 'headerPattern' => '',
207 'table_name' => 'civicrm_contribution_product',
208 'entity' => 'ContributionProduct',
209 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
212 'contribution_start_date' => array(
213 'name' => 'start_date',
214 'type' => CRM_Utils_Type
::T_DATE
,
215 'title' => ts('Start date for premium') ,
216 'description' => 'Actual start date for a time-delimited premium (subscription, service or membership)',
218 'where' => 'civicrm_contribution_product.start_date',
219 'headerPattern' => '',
221 'table_name' => 'civicrm_contribution_product',
222 'entity' => 'ContributionProduct',
223 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
226 'contribution_end_date' => array(
227 'name' => 'end_date',
228 'type' => CRM_Utils_Type
::T_DATE
,
229 'title' => ts('End date for premium') ,
230 'description' => 'Actual end date for a time-delimited premium (subscription, service or membership)',
232 'where' => 'civicrm_contribution_product.end_date',
233 'headerPattern' => '',
235 'table_name' => 'civicrm_contribution_product',
236 'entity' => 'ContributionProduct',
237 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
242 'type' => CRM_Utils_Type
::T_TEXT
,
243 'title' => ts('Premium comment') ,
244 'table_name' => 'civicrm_contribution_product',
245 'entity' => 'ContributionProduct',
246 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
249 'financial_type_id' => array(
250 'name' => 'financial_type_id',
251 'type' => CRM_Utils_Type
::T_INT
,
252 'title' => ts('Financial Type') ,
253 'description' => 'FK to Financial Type(for membership price sets only).',
255 'table_name' => 'civicrm_contribution_product',
256 'entity' => 'ContributionProduct',
257 'bao' => 'CRM_Contribute_DAO_ContributionProduct',
259 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
260 'pseudoconstant' => array(
261 'table' => 'civicrm_financial_type',
263 'labelColumn' => 'name',
267 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
269 return Civi
::$statics[__CLASS__
]['fields'];
272 * Return a mapping from field-name to the corresponding key (as used in fields()).
275 * Array(string $name => string $uniqueName).
277 static function &fieldKeys() {
278 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
279 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
281 return Civi
::$statics[__CLASS__
]['fieldKeys'];
284 * Returns the names of this table
288 static function getTableName() {
289 return self
::$_tableName;
292 * Returns if this table needs to be logged
300 * Returns the list of fields that can be imported
302 * @param bool $prefix
306 static function &import($prefix = false) {
307 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_product', $prefix, array());
311 * Returns the list of fields that can be exported
313 * @param bool $prefix
317 static function &export($prefix = false) {
318 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_product', $prefix, array());
322 * Returns the list of indices
324 public static function indices($localize = TRUE) {
326 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;