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
47 static $_tableName = 'civicrm_price_set_entity';
49 * static instance to hold the field values
54 static $_fields = NULL;
56 * static instance to hold the FK relationships
61 static $_links = NULL;
63 * static instance to hold the values that can
69 static $_import = NULL;
71 * static instance to hold the values that can
77 static $_export = NULL;
79 * static value to see if we should log any modifications to
80 * this table in the civicrm_log table
93 * Table which uses this price set
105 * price set being used
109 public $price_set_id;
114 * @return \CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
116 public function __construct() {
117 $this->__table
= 'civicrm_price_set_entity';
118 parent
::__construct();
122 * return foreign links
126 public function links() {
127 if (!(self
::$_links)) {
128 self
::$_links = array(
129 'price_set_id' => 'civicrm_price_set:id',
132 return self
::$_links;
136 * returns all the column names of this table
140 static function &fields() {
141 if (!(self
::$_fields)) {
142 self
::$_fields = array(
145 'type' => CRM_Utils_Type
::T_INT
,
148 'entity_table' => array(
149 'name' => 'entity_table',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Entity Table'),
154 'size' => CRM_Utils_Type
::BIG
,
156 'entity_id' => array(
157 'name' => 'entity_id',
158 'type' => CRM_Utils_Type
::T_INT
,
161 'price_set_id' => array(
162 'name' => 'price_set_id',
163 'type' => CRM_Utils_Type
::T_INT
,
165 'FKClassName' => 'Snapshot_v4p2_Price_DAO_Set',
169 return self
::$_fields;
173 * returns the names of this table
178 public static function getTableName() {
179 return self
::$_tableName;
183 * returns if this table needs to be logged
187 public function getLog() {
192 * returns the list of fields that can be imported
197 static function &import($prefix = FALSE) {
198 if (!(self
::$_import)) {
199 self
::$_import = array();
200 $fields = self
::fields();
201 foreach ($fields as $name => $field) {
202 if (!empty($field['import'])) {
204 self
::$_import['price_set_entity'] = &$fields[$name];
207 self
::$_import[$name] = &$fields[$name];
212 return self
::$_import;
216 * returns the list of fields that can be exported
221 static function &export($prefix = FALSE) {
222 if (!(self
::$_export)) {
223 self
::$_export = array();
224 $fields = self
::fields();
225 foreach ($fields as $name => $field) {
226 if (!empty($field['export'])) {
228 self
::$_export['price_set_entity'] = &$fields[$name];
231 self
::$_export[$name] = &$fields[$name];
236 return self
::$_export;