3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:16f76907bbd9142b5c8e4820a4bdba34)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_PremiumsProduct
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_premiums_product';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Foreign key to premiums settings record.
96 * Foreign key to each product object.
107 * FK to Financial Type.
111 public $financial_type_id;
115 * @return civicrm_premiums_product
117 function __construct() {
118 $this->__table
= 'civicrm_premiums_product';
119 parent
::__construct();
122 * Returns foreign keys and entity references
125 * [CRM_Core_Reference_Interface]
127 static function getReferenceColumns() {
128 if (!self
::$_links) {
129 self
::$_links = static ::createReferenceColumns(__CLASS__
);
130 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'premiums_id', 'civicrm_premiums', 'id');
131 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'product_id', 'civicrm_product', 'id');
132 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
134 return self
::$_links;
137 * Returns all the column names of this table
141 static function &fields() {
142 if (!(self
::$_fields)) {
143 self
::$_fields = array(
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Premium Product ID') ,
148 'description' => 'Contribution ID',
151 'premiums_id' => array(
152 'name' => 'premiums_id',
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('Premium') ,
155 'description' => 'Foreign key to premiums settings record.',
157 'FKClassName' => 'CRM_Contribute_DAO_Premium',
159 'product_id' => array(
160 'name' => 'product_id',
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Product') ,
163 'description' => 'Foreign key to each product object.',
165 'FKClassName' => 'CRM_Contribute_DAO_Product',
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Order') ,
173 'financial_type_id' => array(
174 'name' => 'financial_type_id',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('Financial Type') ,
177 'description' => 'FK to Financial Type.',
179 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
180 'pseudoconstant' => array(
181 'table' => 'civicrm_financial_type',
183 'labelColumn' => 'name',
188 return self
::$_fields;
191 * Returns an array containing, for each field, the arary key used for that
192 * field in self::$_fields.
196 static function &fieldKeys() {
197 if (!(self
::$_fieldKeys)) {
198 self
::$_fieldKeys = array(
200 'premiums_id' => 'premiums_id',
201 'product_id' => 'product_id',
202 'weight' => 'weight',
203 'financial_type_id' => 'financial_type_id',
206 return self
::$_fieldKeys;
209 * Returns the names of this table
213 static function getTableName() {
214 return self
::$_tableName;
217 * Returns if this table needs to be logged
225 * Returns the list of fields that can be imported
227 * @param bool $prefix
231 static function &import($prefix = false) {
232 if (!(self
::$_import)) {
233 self
::$_import = array();
234 $fields = self
::fields();
235 foreach($fields as $name => $field) {
236 if (CRM_Utils_Array
::value('import', $field)) {
238 self
::$_import['premiums_product'] = & $fields[$name];
240 self
::$_import[$name] = & $fields[$name];
245 return self
::$_import;
248 * Returns the list of fields that can be exported
250 * @param bool $prefix
254 static function &export($prefix = false) {
255 if (!(self
::$_export)) {
256 self
::$_export = array();
257 $fields = self
::fields();
258 foreach($fields as $name => $field) {
259 if (CRM_Utils_Array
::value('export', $field)) {
261 self
::$_export['premiums_product'] = & $fields[$name];
263 self
::$_export[$name] = & $fields[$name];
268 return self
::$_export;