__table = 'civicrm_wci_progress_bar_formula'; parent::__construct(); } /** * return foreign keys and entity references * * @static * @access public * @return array of CRM_Core_EntityReference */ static function getReferenceColumns() { if (!self::$_links) { self::$_links = array( new CRM_Core_EntityReference(self::getTableName() , 'progress_bar_id', 'civicrm_wci_progress_bar', 'id') , new CRM_Core_EntityReference(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id') , ); } return self::$_links; } /** * returns all the column names of this table * * @access public * @return array */ static function &fields() { if (!(self::$_fields)) { self::$_fields = array( 'progress_bar_formula_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('WCI Progress Bar Formula Entry Id', array('domain' => 'org.civicrm.wci')) , 'required' => true, ) , 'contribution_page_id' => array( 'name' => 'contribution_page_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution Page Reference Id', array('domain' => 'org.civicrm.wci')) , 'required' => true, ) , 'progress_bar_id' => array( 'name' => 'progress_bar_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Progress Bar Reference Id', array('domain' => 'org.civicrm.wci')) , 'required' => true, ) , 'percentage' => array( 'name' => 'percentage', 'type' => CRM_Utils_Type::T_FLOAT, 'title' => ts('Percentage Amount', array('domain' => 'org.civicrm.wci')) , 'required' => true, ) , ); } return self::$_fields; } /** * Returns an array containing, for each field, the arary key used for that * field in self::$_fields. * * @access public * @return array */ static function &fieldKeys() { if (!(self::$_fieldKeys)) { self::$_fieldKeys = array( 'id' => 'progress_bar_formula_id', 'contribution_page_id' => 'contribution_page_id', 'progress_bar_id' => 'progress_bar_id', 'percentage' => 'percentage', ); } return self::$_fieldKeys; } /** * returns the names of this table * * @access public * @static * @return string */ static function getTableName() { return self::$_tableName; } /** * returns if this table needs to be logged * * @access public * @return boolean */ function getLog() { return self::$_log; } /** * returns the list of fields that can be imported * * @access public * return array * @static */ static function &import($prefix = false) { if (!(self::$_import)) { self::$_import = array(); $fields = self::fields(); foreach($fields as $name => $field) { if (CRM_Utils_Array::value('import', $field)) { if ($prefix) { self::$_import['wci_progress_bar_formula'] = & $fields[$name]; } else { self::$_import[$name] = & $fields[$name]; } } } } return self::$_import; } /** * returns the list of fields that can be exported * * @access public * return array * @static */ static function &export($prefix = false) { if (!(self::$_export)) { self::$_export = array(); $fields = self::fields(); foreach($fields as $name => $field) { if (CRM_Utils_Array::value('export', $field)) { if ($prefix) { self::$_export['wci_progress_bar_formula'] = & $fields[$name]; } else { self::$_export[$name] = & $fields[$name]; } } } } return self::$_export; } }