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_ProgressBar
extends CRM_Core_DAO
35 * static instance to hold the table name
40 static $_tableName = 'civicrm_wci_progress_bar';
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 * Name of progress bar
99 * Arbitrary starting amount
103 public $starting_amount;
104 function __construct()
106 $this->__table
= 'civicrm_wci_progress_bar';
107 parent
::__construct();
110 * return foreign keys and entity references
114 * @return array of CRM_Core_EntityReference
116 static function getReferenceColumns()
118 return self
::$_links;
121 * returns all the column names of this table
126 static function &fields()
128 if (!(self
::$_fields)) {
129 self
::$_fields = array(
130 'progress_bar_id' => array(
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('WCI Progress Bar Id', array('domain' => 'org.civicrm.wci')) ,
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Progress Bar Name', array('domain' => 'org.civicrm.wci')) ,
143 'starting_amount' => array(
144 'name' => 'starting_amount',
145 'type' => CRM_Utils_Type
::T_FLOAT
,
148 'goal_amount' => array(
149 'name' => 'goal_amount',
150 'type' => CRM_Utils_Type
::T_FLOAT
,
155 return self
::$_fields;
158 * Returns an array containing, for each field, the arary key used for that
159 * field in self::$_fields.
164 static function &fieldKeys()
166 if (!(self
::$_fieldKeys)) {
167 self
::$_fieldKeys = array(
168 'id' => 'progress_bar_id',
170 'starting_amount' => 'starting_amount',
171 'goal_amount' => 'goal_amount',
174 return self
::$_fieldKeys;
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 (CRM_Utils_Array
::value('import', $field)) {
212 self
::$_import['wci_progress_bar'] = & $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 (CRM_Utils_Array
::value('export', $field)) {
236 self
::$_export['wci_progress_bar'] = & $fields[$name];
238 self
::$_export[$name] = & $fields[$name];
243 return self
::$_export;