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 require_once 'CRM/Core/DAO.php';
33 require_once 'CRM/Utils/Type.php';
34 class CRM_WCI_DAO_ProgressBar
extends CRM_Core_DAO
37 * static instance to hold the table name
42 static $_tableName = 'civicrm_wci_progress_bar';
44 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
56 static $_fieldKeys = null;
58 * static instance to hold the FK relationships
63 static $_links = null;
65 * static instance to hold the values that can
71 static $_import = null;
73 * static instance to hold the values that can
79 static $_export = null;
81 * static value to see if we should log any modifications to
82 * this table in the civicrm_log table
95 * Name of progress bar
101 * Arbitrary starting amount
105 public $starting_amount;
106 function __construct()
108 $this->__table
= 'civicrm_wci_progress_bar';
109 parent
::__construct();
112 * return foreign keys and entity references
116 * @return array of CRM_Core_EntityReference
118 static function getReferenceColumns()
120 return self
::$_links;
123 * returns all the column names of this table
128 static function &fields()
130 if (!(self
::$_fields)) {
131 self
::$_fields = array(
132 'progress_bar_id' => array(
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('WCI Progress Bar Id', array('domain' => 'org.civicrm.wci')) ,
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Progress Bar Name', array('domain' => 'org.civicrm.wci')) ,
145 'starting_amount' => array(
146 'name' => 'starting_amount',
147 'type' => CRM_Utils_Type
::T_FLOAT
,
152 return self
::$_fields;
155 * Returns an array containing, for each field, the arary key used for that
156 * field in self::$_fields.
161 static function &fieldKeys()
163 if (!(self
::$_fieldKeys)) {
164 self
::$_fieldKeys = array(
165 'id' => 'progress_bar_id',
167 'starting_amount' => 'starting_amount',
170 return self
::$_fieldKeys;
173 * returns the names of this table
179 static function getTableName()
181 return self
::$_tableName;
184 * returns if this table needs to be logged
194 * returns the list of fields that can be imported
200 static function &import($prefix = false)
202 if (!(self
::$_import)) {
203 self
::$_import = array();
204 $fields = self
::fields();
205 foreach($fields as $name => $field) {
206 if (CRM_Utils_Array
::value('import', $field)) {
208 self
::$_import['wci_progress_bar'] = & $fields[$name];
210 self
::$_import[$name] = & $fields[$name];
215 return self
::$_import;
218 * returns the list of fields that can be exported
224 static function &export($prefix = false)
226 if (!(self
::$_export)) {
227 self
::$_export = array();
228 $fields = self
::fields();
229 foreach($fields as $name => $field) {
230 if (CRM_Utils_Array
::value('export', $field)) {
232 self
::$_export['wci_progress_bar'] = & $fields[$name];
234 self
::$_export[$name] = & $fields[$name];
239 return self
::$_export;