commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Contribute / DAO / PremiumsProduct.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_premiums_product';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = true;
82 /**
83 * Contribution ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Foreign key to premiums settings record.
90 *
91 * @var int unsigned
92 */
93 public $premiums_id;
94 /**
95 * Foreign key to each product object.
96 *
97 * @var int unsigned
98 */
99 public $product_id;
100 /**
101 *
102 * @var int unsigned
103 */
104 public $weight;
105 /**
106 * FK to Financial Type.
107 *
108 * @var int unsigned
109 */
110 public $financial_type_id;
111 /**
112 * class constructor
113 *
114 * @return civicrm_premiums_product
115 */
116 function __construct() {
117 $this->__table = 'civicrm_premiums_product';
118 parent::__construct();
119 }
120 /**
121 * Returns foreign keys and entity references
122 *
123 * @return array
124 * [CRM_Core_Reference_Interface]
125 */
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');
132 }
133 return self::$_links;
134 }
135 /**
136 * Returns all the column names of this table
137 *
138 * @return array
139 */
140 static function &fields() {
141 if (!(self::$_fields)) {
142 self::$_fields = array(
143 'id' => array(
144 'name' => 'id',
145 'type' => CRM_Utils_Type::T_INT,
146 'description' => 'Contribution ID',
147 'required' => true,
148 ) ,
149 'premiums_id' => array(
150 'name' => 'premiums_id',
151 'type' => CRM_Utils_Type::T_INT,
152 'description' => 'Foreign key to premiums settings record.',
153 'required' => true,
154 'FKClassName' => 'CRM_Contribute_DAO_Premium',
155 ) ,
156 'product_id' => array(
157 'name' => 'product_id',
158 'type' => CRM_Utils_Type::T_INT,
159 'description' => 'Foreign key to each product object.',
160 'required' => true,
161 'FKClassName' => 'CRM_Contribute_DAO_Product',
162 ) ,
163 'weight' => array(
164 'name' => 'weight',
165 'type' => CRM_Utils_Type::T_INT,
166 'title' => ts('Order') ,
167 'required' => true,
168 ) ,
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.',
174 'default' => 'NULL',
175 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
176 'pseudoconstant' => array(
177 'table' => 'civicrm_financial_type',
178 'keyColumn' => 'id',
179 'labelColumn' => 'name',
180 )
181 ) ,
182 );
183 }
184 return self::$_fields;
185 }
186 /**
187 * Returns an array containing, for each field, the arary key used for that
188 * field in self::$_fields.
189 *
190 * @return array
191 */
192 static function &fieldKeys() {
193 if (!(self::$_fieldKeys)) {
194 self::$_fieldKeys = array(
195 'id' => 'id',
196 'premiums_id' => 'premiums_id',
197 'product_id' => 'product_id',
198 'weight' => 'weight',
199 'financial_type_id' => 'financial_type_id',
200 );
201 }
202 return self::$_fieldKeys;
203 }
204 /**
205 * Returns the names of this table
206 *
207 * @return string
208 */
209 static function getTableName() {
210 return self::$_tableName;
211 }
212 /**
213 * Returns if this table needs to be logged
214 *
215 * @return boolean
216 */
217 function getLog() {
218 return self::$_log;
219 }
220 /**
221 * Returns the list of fields that can be imported
222 *
223 * @param bool $prefix
224 *
225 * @return array
226 */
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)) {
233 if ($prefix) {
234 self::$_import['premiums_product'] = & $fields[$name];
235 } else {
236 self::$_import[$name] = & $fields[$name];
237 }
238 }
239 }
240 }
241 return self::$_import;
242 }
243 /**
244 * Returns the list of fields that can be exported
245 *
246 * @param bool $prefix
247 *
248 * @return array
249 */
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)) {
256 if ($prefix) {
257 self::$_export['premiums_product'] = & $fields[$name];
258 } else {
259 self::$_export[$name] = & $fields[$name];
260 }
261 }
262 }
263 }
264 return self::$_export;
265 }
266 }