Class: iHRIS FormField CURRENCY: Difference between revisions

From IHRIS Wiki
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article describes the class ''iHRIS_FormField_CURRENCY''.
#REDIRECT [[Class: iHRIS_FormField_CURRENCY (4.1.7)]]
*Extends the class: [[Class: I2CE_FormField_MAP | I2CE_FormField_MAP]].
*Parent Classses:  [[Class: I2CE_FormField_MAP | I2CE_FormField_MAP]] [[Class: I2CE_FormField_MAPPED | I2CE_FormField_MAPPED]] [[Class: I2CE_FormField_DB_STRING | I2CE_FormField_DB_STRING]] [[Class: I2CE_FormField | I2CE_FormField]] [[Class: I2CE_Fuzzy | I2CE_Fuzzy]]
*Location: Part of the module [[iHRIS Common Module List#Currency|Currency]] in the package [https://launchpad.net/ihris-common iHRIS Common]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/ihris-common/4.0.0-release/annotate/head:/modules/Currency/lib/iHRIS_FormField_CURRENCY.php modules/Currency/lib/iHRIS_FormField_CURRENCY.php]
*Author: Luke Duncan <lduncan@intrahealth.org>
*Since: v2.0.0
@copyright Copyright &copy; 2007, 2008 IntraHealth International, Inc.    Class for defining all the database fields used by a [[Class: I2CE_Form | ]] 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:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $db_value <br/>Either a DB Value or an I2CE_FormField
*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:
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node <br/>the node we wish to add the drop down list under @pararm array $fields
** [[Class: I2CE_Template | I2CE_Template]] $template
**$form_node
**$fields
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>The selectable forms for this map.  Order does not matter
** [http://www.php.net/manual/en/language.types.array.php array ] $limits <br/>An array, indexed by form name, of limiting data
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>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:
** [http://www.php.net/manual/en/language.types.string.php string ] $db_value <br/>The non-componentized value
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>of stirng. The form names which we wish to componentize.
** [http://www.php.net/manual/en/language.types.string.php string ] $component <br/>The component we wish to encode
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>The componentized db_value
===getDBValue()===
*Signature: public function getDBValue()
===getDefaultDisplayStyle()===
Return the default display style for this mapped field.
*Signature: public function getDefaultDisplayStyle($type)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $type
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getDisplayNode()===
Return the display value of this form field as a DOM Node.
*Signature: public function getDisplayNode($node,$template)
*Parameters:
** [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node
** [[Class: I2CE_Template | I2CE_Template]] $template
*Returns: [http://www.php.net/manual/en/class.domnode.php DOMNode ]
===getDisplayValue()===
Returns the value of this field as a human readable format.
*Signature: public function getDisplayValue($entry,$number_format)
*Parameters:
** [[Class: I2CE_Entry | I2CE_Entry]] $entry <br/>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
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $number_format <br/>If true, call number_format on the returned value.
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===getDisplayedFields()===
Return the displayed fields for this field.  CURRENCY field types can only select the current field.
*Signature: public function getDisplayedFields($display)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $display
***Default Value: 'default'
*Returns: [http://www.php.net/manual/en/language.types.array.php 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:
** [http://www.php.net/manual/en/language.types.string.php string ] $display
***Default Value: 'default'
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getFormLimits()===
Return the form limits for this field.  CURRENCY doesn't support form limits for now.
*Signature: public function getFormLimits($type)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $type
***Default Value: 'default'
*Returns: [http://www.php.net/manual/en/language.types.string.php 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:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
===getSQLComponentization()===
Componentizes the given $db_value based on component
*Signature: public function getSQLComponentization($db_ref,$forms,$component)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $db_ref <br/>The reference to the data
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>of stirng. The form names which we wish to componentize.
** [http://www.php.net/manual/en/language.types.string.php string ] $component <br/>The component we wish to encode
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>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: [http://www.php.net/manual/en/language.types.array.php 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: [http://www.php.net/manual/en/language.types.boolean.php 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:
** [http://www.php.net/manual/en/language.types.array.php array ] $post <br/>The $_POST array holding the values for this form.
 
 
[[Category:Class Documentation]]

Latest revision as of 08:56, 23 August 2013