3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
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-2013
32 class CRM_Wci_DAO_ProgressBarFormula
extends CRM_Core_DAO
35 * static instance to hold the table name
40 static $_tableName = 'civicrm_wci_progress_bar_formula';
42 * static instance to hold the field values
47 static $_fields = null;
49 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = 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 * Contribution page reference id
97 public $contribution_page_id;
99 * Progress bar reference id
103 public $progress_bar_id;
110 function __construct()
112 $this->__table
= 'civicrm_wci_progress_bar_formula';
113 parent
::__construct();
116 * return foreign keys and entity references
120 * @return array of CRM_Core_EntityReference
122 static function getReferenceColumns()
124 if (!self
::$_links) {
125 self
::$_links = array(
126 new CRM_Core_EntityReference(self
::getTableName() , 'progress_bar_id', 'civicrm_wci_progress_bar', 'id') ,
127 new CRM_Core_EntityReference(self
::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id') ,
130 return self
::$_links;
133 * returns all the column names of this table
138 static function &fields()
140 if (!(self
::$_fields)) {
141 self
::$_fields = array(
142 'progress_bar_formula_id' => array(
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('WCI Progress Bar Formula Entry Id', array('domain' => 'org.civicrm.wci')) ,
148 'contribution_page_id' => array(
149 'name' => 'contribution_page_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Contribution Page Reference Id', array('domain' => 'org.civicrm.wci')) ,
154 'progress_bar_id' => array(
155 'name' => 'progress_bar_id',
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Progress Bar Reference Id', array('domain' => 'org.civicrm.wci')) ,
160 'percentage' => array(
161 'name' => 'percentage',
162 'type' => CRM_Utils_Type
::T_FLOAT
,
163 'title' => ts('Percentage Amount', array('domain' => 'org.civicrm.wci')) ,
168 return self
::$_fields;
171 * Returns an array containing, for each field, the arary key used for that
172 * field in self::$_fields.
177 static function &fieldKeys()
179 if (!(self
::$_fieldKeys)) {
180 self
::$_fieldKeys = array(
181 'id' => 'progress_bar_formula_id',
182 'contribution_page_id' => 'contribution_page_id',
183 'progress_bar_id' => 'progress_bar_id',
184 'percentage' => 'percentage',
187 return self
::$_fieldKeys;
190 * returns the names of this table
196 static function getTableName()
198 return self
::$_tableName;
201 * returns if this table needs to be logged
211 * returns the list of fields that can be imported
217 static function &import($prefix = false)
219 if (!(self
::$_import)) {
220 self
::$_import = array();
221 $fields = self
::fields();
222 foreach($fields as $name => $field) {
223 if (CRM_Utils_Array
::value('import', $field)) {
225 self
::$_import['wci_progress_bar_formula'] = & $fields[$name];
228 self
::$_import[$name] = & $fields[$name];
233 return self
::$_import;
236 * returns the list of fields that can be exported
242 static function &export($prefix = false)
244 if (!(self
::$_export)) {
245 self
::$_export = array();
246 $fields = self
::fields();
247 foreach($fields as $name => $field) {
248 if (CRM_Utils_Array
::value('export', $field)) {
250 self
::$_export['wci_progress_bar_formula'] = & $fields[$name];
253 self
::$_export[$name] = & $fields[$name];
258 return self
::$_export;