Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Contribute / DAO / PremiumsProduct.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3580529cebca0659c28e8d4f55015c22)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_premiums_product';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = true;
69 /**
70 * Contribution ID
71 *
72 * @var int unsigned
73 */
74 public $id;
75 /**
76 * Foreign key to premiums settings record.
77 *
78 * @var int unsigned
79 */
80 public $premiums_id;
81 /**
82 * Foreign key to each product object.
83 *
84 * @var int unsigned
85 */
86 public $product_id;
87 /**
88 *
89 * @var int unsigned
90 */
91 public $weight;
92 /**
93 * FK to Financial Type.
94 *
95 * @var int unsigned
96 */
97 public $financial_type_id;
98 /**
99 * class constructor
100 *
101 * @return civicrm_premiums_product
102 */
103 function __construct() {
104 $this->__table = 'civicrm_premiums_product';
105 parent::__construct();
106 }
107 /**
108 * Returns foreign keys and entity references
109 *
110 * @return array
111 * [CRM_Core_Reference_Interface]
112 */
113 static function getReferenceColumns() {
114 if (!self::$_links) {
115 self::$_links = static ::createReferenceColumns(__CLASS__);
116 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'premiums_id', 'civicrm_premiums', 'id');
117 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'product_id', 'civicrm_product', 'id');
118 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
119 }
120 return self::$_links;
121 }
122 /**
123 * Returns all the column names of this table
124 *
125 * @return array
126 */
127 static function &fields() {
128 if (!(self::$_fields)) {
129 self::$_fields = array(
130 'id' => array(
131 'name' => 'id',
132 'type' => CRM_Utils_Type::T_INT,
133 'title' => ts('Premium Product ID') ,
134 'description' => 'Contribution ID',
135 'required' => true,
136 ) ,
137 'premiums_id' => array(
138 'name' => 'premiums_id',
139 'type' => CRM_Utils_Type::T_INT,
140 'title' => ts('Premium') ,
141 'description' => 'Foreign key to premiums settings record.',
142 'required' => true,
143 'FKClassName' => 'CRM_Contribute_DAO_Premium',
144 ) ,
145 'product_id' => array(
146 'name' => 'product_id',
147 'type' => CRM_Utils_Type::T_INT,
148 'title' => ts('Product') ,
149 'description' => 'Foreign key to each product object.',
150 'required' => true,
151 'FKClassName' => 'CRM_Contribute_DAO_Product',
152 ) ,
153 'weight' => array(
154 'name' => 'weight',
155 'type' => CRM_Utils_Type::T_INT,
156 'title' => ts('Order') ,
157 'required' => true,
158 ) ,
159 'financial_type_id' => array(
160 'name' => 'financial_type_id',
161 'type' => CRM_Utils_Type::T_INT,
162 'title' => ts('Financial Type') ,
163 'description' => 'FK to Financial Type.',
164 'default' => 'NULL',
165 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
166 'pseudoconstant' => array(
167 'table' => 'civicrm_financial_type',
168 'keyColumn' => 'id',
169 'labelColumn' => 'name',
170 )
171 ) ,
172 );
173 }
174 return self::$_fields;
175 }
176 /**
177 * Returns an array containing, for each field, the arary key used for that
178 * field in self::$_fields.
179 *
180 * @return array
181 */
182 static function &fieldKeys() {
183 if (!(self::$_fieldKeys)) {
184 self::$_fieldKeys = array(
185 'id' => 'id',
186 'premiums_id' => 'premiums_id',
187 'product_id' => 'product_id',
188 'weight' => 'weight',
189 'financial_type_id' => 'financial_type_id',
190 );
191 }
192 return self::$_fieldKeys;
193 }
194 /**
195 * Returns the names of this table
196 *
197 * @return string
198 */
199 static function getTableName() {
200 return self::$_tableName;
201 }
202 /**
203 * Returns if this table needs to be logged
204 *
205 * @return boolean
206 */
207 function getLog() {
208 return self::$_log;
209 }
210 /**
211 * Returns the list of fields that can be imported
212 *
213 * @param bool $prefix
214 *
215 * @return array
216 */
217 static function &import($prefix = false) {
218 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'premiums_product', $prefix, array());
219 return $r;
220 }
221 /**
222 * Returns the list of fields that can be exported
223 *
224 * @param bool $prefix
225 *
226 * @return array
227 */
228 static function &export($prefix = false) {
229 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'premiums_product', $prefix, array());
230 return $r;
231 }
232 }