3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Contribute_DAO_PremiumsProduct
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_premiums_product';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * Foreign key to premiums settings record.
95 * Foreign key to each product object.
106 * FK to Financial Type.
110 public $financial_type_id;
114 * @return civicrm_premiums_product
116 function __construct() {
117 $this->__table
= 'civicrm_premiums_product';
118 parent
::__construct();
121 * Returns foreign keys and entity references
124 * [CRM_Core_Reference_Interface]
126 static function getReferenceColumns() {
127 if (!self
::$_links) {
128 self
::$_links = static ::createReferenceColumns(__CLASS__
);
129 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'premiums_id', 'civicrm_premiums', 'id');
130 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'product_id', 'civicrm_product', 'id');
131 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
133 return self
::$_links;
136 * Returns all the column names of this table
140 static function &fields() {
141 if (!(self
::$_fields)) {
142 self
::$_fields = array(
145 'type' => CRM_Utils_Type
::T_INT
,
146 'description' => 'Contribution ID',
149 'premiums_id' => array(
150 'name' => 'premiums_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'description' => 'Foreign key to premiums settings record.',
154 'FKClassName' => 'CRM_Contribute_DAO_Premium',
156 'product_id' => array(
157 'name' => 'product_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'description' => 'Foreign key to each product object.',
161 'FKClassName' => 'CRM_Contribute_DAO_Product',
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Order') ,
169 'financial_type_id' => array(
170 'name' => 'financial_type_id',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Financial Type') ,
173 'description' => 'FK to Financial Type.',
175 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
176 'pseudoconstant' => array(
177 'table' => 'civicrm_financial_type',
179 'labelColumn' => 'name',
184 return self
::$_fields;
187 * Returns an array containing, for each field, the arary key used for that
188 * field in self::$_fields.
192 static function &fieldKeys() {
193 if (!(self
::$_fieldKeys)) {
194 self
::$_fieldKeys = array(
196 'premiums_id' => 'premiums_id',
197 'product_id' => 'product_id',
198 'weight' => 'weight',
199 'financial_type_id' => 'financial_type_id',
202 return self
::$_fieldKeys;
205 * Returns the names of this table
209 static function getTableName() {
210 return self
::$_tableName;
213 * Returns if this table needs to be logged
221 * Returns the list of fields that can be imported
223 * @param bool $prefix
227 static function &import($prefix = false) {
228 if (!(self
::$_import)) {
229 self
::$_import = array();
230 $fields = self
::fields();
231 foreach($fields as $name => $field) {
232 if (CRM_Utils_Array
::value('import', $field)) {
234 self
::$_import['premiums_product'] = & $fields[$name];
236 self
::$_import[$name] = & $fields[$name];
241 return self
::$_import;
244 * Returns the list of fields that can be exported
246 * @param bool $prefix
250 static function &export($prefix = false) {
251 if (!(self
::$_export)) {
252 self
::$_export = array();
253 $fields = self
::fields();
254 foreach($fields as $name => $field) {
255 if (CRM_Utils_Array
::value('export', $field)) {
257 self
::$_export['premiums_product'] = & $fields[$name];
259 self
::$_export[$name] = & $fields[$name];
264 return self
::$_export;