Class: iHRIS FormField CURRENCY
This article describes the class iHRIS_FormField_CURRENCY.
- Extends the class: I2CE_FormField_MAP.
- Parent Classses: I2CE_FormField_MAP I2CE_FormField_MAPPED I2CE_FormField_DB_STRING I2CE_FormField I2CE_Fuzzy
- Location: Part of the module Currency in the package iHRIS Common
- Source: Defined in the file modules/Currency/lib/iHRIS_FormField_CURRENCY.php
- Author: Luke Duncan <lduncan@intrahealth.org>
- Since: v2.0.0
@copyright Copyright © 2007, 2008 IntraHealth International, Inc. Class for defining all the database fields used by a object.
Methods
add()
Add the given value to the value of this field.
- Signature: public function add($value)
- Parameters:
- $value
compare()
Compares this form field agains the given form field.
- Signature: public function compare($db_value)
- Parameters:
- mixed $db_value
Either a DB Value or an I2CE_FormField
- mixed $db_value
- Returns: -1,0,1
create_DOMEditable_list()
Creates a drop down list of options.
- Signature: protected function create_DOMEditable_list($node,$template,$form_node,$fields,$forms,$limits)
- Parameters:
- DOMNode $node
the node we wish to add the drop down list under @pararm array $fields - I2CE_Template $template
- $form_node
- $fields
- array $forms
The selectable forms for this map. Order does not matter - array $limits
An array, indexed by form name, of limiting data
- DOMNode $node
- Returns: mixed
DOMNode or an array of DOMNodes to add.
getComponentizedValue()
Componentizes the given $db_value based on component
- Signature: public function getComponentizedValue($db_value,$forms,$component)
- Parameters:
- Returns: string
The componentized db_value
getDBValue()
- Signature: public function getDBValue()
getDefaultDisplayStyle()
Return the default display style for this mapped field.
getDisplayNode()
Return the display value of this form field as a DOM Node.
- Signature: public function getDisplayNode($node,$template)
- Parameters:
- DOMNode $node
- I2CE_Template $template
- Returns: DOMNode
getDisplayValue()
Returns the value of this field as a human readable format.
- Signature: public function getDisplayValue($entry,$number_format)
- Parameters:
- I2CE_Entry $entry
If a I2CE_Entry object has been passed to this method then it will return the value for that entry assuming it's an entry for this field.- Default Value: false
- boolean $number_format
If true, call number_format on the returned value.- Default Value: false
- I2CE_Entry $entry
- Returns: mixed
getDisplayedFields()
Return the displayed fields for this field. CURRENCY field types can only select the current field.
- Signature: public function getDisplayedFields($display)
- Parameters:
- string $display
- Default Value: 'default'
- string $display
- Returns: array
getDisplayedStyle()
Return the displayed style for the given display type. CURRENCT field can only have one option so ignore anything given.
- Signature: public function getDisplayedStyle($display)
- Parameters:
- string $display
- Default Value: 'default'
- string $display
- Returns: string
getFormLimits()
Return the form limits for this field. CURRENCY doesn't support form limits for now.
- Signature: public function getFormLimits($type)
- Parameters:
- string $type
- Default Value: 'default'
- string $type
- Returns: string
getFromDB()
Return the value of this field from the database format for the given type @param integer $type The type of the field to be returned.
- Signature: public function getFromDB($value)
- Parameters:
- mixed $value
getSQLComponentization()
Componentizes the given $db_value based on component
- Signature: public function getSQLComponentization($db_ref,$forms,$component)
- Parameters:
- Returns: string
The componentized db_value
getSelectableForms()
Return the selectable forms for this field. CURRENCY field types can only select "currency" forms.
- Signature: public function getSelectableForms()
- Returns: array
getValue()
- Signature: public function getValue()
isValid()
Checks to see if the current value for this is set and valid.
- Signature: public function isValid()
- Returns: boolean
multiply()
Multiply the value of this field by the given value.
- Signature: public function multiply($value)
- Parameters:
- $value
setFromPost()
Sets the value of this field from the posted form.
- Signature: public function setFromPost($post)
- Parameters:
- array $post
The $_POST array holding the values for this form.
- array $post