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
{
42 * static instance to hold the table name
46 static $_tableName = 'civicrm_price_set_entity';
48 * static instance to hold the field values
52 static $_fields = NULL;
54 * static instance to hold the FK relationships
58 static $_links = NULL;
60 * static instance to hold the values that can
65 static $_import = NULL;
67 * static instance to hold the values that can
72 static $_export = NULL;
74 * static value to see if we should log any modifications to
75 * this table in the civicrm_log table
87 * Table which uses this price set
99 * price set being used
103 public $price_set_id;
108 * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
110 public function __construct() {
111 $this->__table
= 'civicrm_price_set_entity';
112 parent
::__construct();
116 * Return foreign links.
120 public function links() {
121 if (!(self
::$_links)) {
122 self
::$_links = array(
123 'price_set_id' => 'civicrm_price_set:id',
126 return self
::$_links;
130 * Returns all the column names of this table.
134 static function &fields() {
135 if (!(self
::$_fields)) {
136 self
::$_fields = array(
139 'type' => CRM_Utils_Type
::T_INT
,
142 'entity_table' => array(
143 'name' => 'entity_table',
144 'type' => CRM_Utils_Type
::T_STRING
,
145 'title' => ts('Entity Table'),
148 'size' => CRM_Utils_Type
::BIG
,
150 'entity_id' => array(
151 'name' => 'entity_id',
152 'type' => CRM_Utils_Type
::T_INT
,
155 'price_set_id' => array(
156 'name' => 'price_set_id',
157 'type' => CRM_Utils_Type
::T_INT
,
159 'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
163 return self
::$_fields;
167 * returns the names of this table.
171 public static function getTableName() {
172 return self
::$_tableName;
176 * returns if this table needs to be logged.
180 public function getLog() {
185 * returns the list of fields that can be imported.
189 static function &import($prefix = FALSE) {
190 if (!(self
::$_import)) {
191 self
::$_import = array();
192 $fields = self
::fields();
193 foreach ($fields as $name => $field) {
194 if (!empty($field['import'])) {
196 self
::$_import['price_set_entity'] = &$fields[$name];
199 self
::$_import[$name] = &$fields[$name];
204 return self
::$_import;
208 * returns the list of fields that can be exported.
212 static function &export($prefix = FALSE) {
213 if (!(self
::$_export)) {
214 self
::$_export = array();
215 $fields = self
::fields();
216 foreach ($fields as $name => $field) {
217 if (!empty($field['export'])) {
219 self
::$_export['price_set_entity'] = &$fields[$name];
222 self
::$_export[$name] = &$fields[$name];
227 return self
::$_export;