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;
115 * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
117 public function __construct()
119 $this->__table
= 'civicrm_price_set_entity';
120 parent
::__construct();
123 * return foreign links
127 public function links()
129 if (!(self
::$_links)) {
130 self
::$_links = array(
131 'price_set_id' => 'civicrm_price_set:id',
134 return self
::$_links;
137 * returns all the column names of this table
141 static function &fields()
143 if (!(self
::$_fields)) {
144 self
::$_fields = array(
147 'type' => CRM_Utils_Type
::T_INT
,
150 'entity_table' => array(
151 'name' => 'entity_table',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Entity Table') ,
156 'size' => CRM_Utils_Type
::BIG
,
158 'entity_id' => array(
159 'name' => 'entity_id',
160 'type' => CRM_Utils_Type
::T_INT
,
163 'price_set_id' => array(
164 'name' => 'price_set_id',
165 'type' => CRM_Utils_Type
::T_INT
,
167 'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
171 return self
::$_fields;
174 * returns the names of this table
179 public static function getTableName()
181 return self
::$_tableName;
184 * returns if this table needs to be logged
188 public function getLog()
193 * returns the list of fields that can be imported
198 static function &import($prefix = false)
200 if (!(self
::$_import)) {
201 self
::$_import = array();
202 $fields = self
::fields();
203 foreach($fields as $name => $field) {
204 if (!empty($field['import'])) {
206 self
::$_import['price_set_entity'] = & $fields[$name];
208 self
::$_import[$name] = & $fields[$name];
213 return self
::$_import;
216 * returns the list of fields that can be exported
221 static function &export($prefix = false)
223 if (!(self
::$_export)) {
224 self
::$_export = array();
225 $fields = self
::fields();
226 foreach($fields as $name => $field) {
227 if (!empty($field['export'])) {
229 self
::$_export['price_set_entity'] = & $fields[$name];
231 self
::$_export[$name] = & $fields[$name];
236 return self
::$_export;