3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
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 +--------------------------------------------------------------------+
30 * @copyright CiviCRM LLC (c) 2004-2014
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
38 * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
40 class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
extends CRM_Core_DAO
43 * static instance to hold the table name
48 static $_tableName = 'civicrm_price_set_entity';
50 * static instance to hold the field values
55 static $_fields = null;
57 * static instance to hold the FK relationships
62 static $_links = null;
64 * static instance to hold the values that can
70 static $_import = null;
72 * static instance to hold the values that can
78 static $_export = null;
80 * static value to see if we should log any modifications to
81 * this table in the civicrm_log table
94 * Table which uses this price set
106 * price set being used
110 public $price_set_id;
116 * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
118 function __construct()
120 $this->__table
= 'civicrm_price_set_entity';
121 parent
::__construct();
124 * return foreign links
131 if (!(self
::$_links)) {
132 self
::$_links = array(
133 'price_set_id' => 'civicrm_price_set:id',
136 return self
::$_links;
139 * returns all the column names of this table
144 static function &fields()
146 if (!(self
::$_fields)) {
147 self
::$_fields = array(
150 'type' => CRM_Utils_Type
::T_INT
,
153 'entity_table' => array(
154 'name' => 'entity_table',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Entity Table') ,
159 'size' => CRM_Utils_Type
::BIG
,
161 'entity_id' => array(
162 'name' => 'entity_id',
163 'type' => CRM_Utils_Type
::T_INT
,
166 'price_set_id' => array(
167 'name' => 'price_set_id',
168 'type' => CRM_Utils_Type
::T_INT
,
170 'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
174 return self
::$_fields;
177 * returns the names of this table
183 static function getTableName()
185 return self
::$_tableName;
188 * returns if this table needs to be logged
198 * returns the list of fields that can be imported
204 static function &import($prefix = false)
206 if (!(self
::$_import)) {
207 self
::$_import = array();
208 $fields = self
::fields();
209 foreach($fields as $name => $field) {
210 if (!empty($field['import'])) {
212 self
::$_import['price_set_entity'] = & $fields[$name];
214 self
::$_import[$name] = & $fields[$name];
219 return self
::$_import;
222 * returns the list of fields that can be exported
228 static function &export($prefix = false)
230 if (!(self
::$_export)) {
231 self
::$_export = array();
232 $fields = self
::fields();
233 foreach($fields as $name => $field) {
234 if (!empty($field['export'])) {
236 self
::$_export['price_set_entity'] = & $fields[$name];
238 self
::$_export[$name] = & $fields[$name];
243 return self
::$_export;