Class: iHRIS FormField CURRENCY: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 1: Line 1:
This article desrcibes the class '''iHRIS_FormField_CURRENCY''' which extends the class [[Class: I2CE_FormField_MAP | I2CE_FormField_MAP]]
This article desrcibes the class '''iHRIS_FormField_CURRENCY'''.
*Extends the class: [[Class: I2CE_FormField_MAP | I2CE_FormField_MAP]].
It is contained in the module [[iHRIS Module List#Currency|Currency]] in the package [https://launchpad.net/ihris-common iHRIS Common]
It is contained in the module [[iHRIS Module List#Currency|Currency]] in the package [https://launchpad.net/ihris-common iHRIS Common]


Line 19: Line 20:
*Returns: -1,0,1
*Returns: -1,0,1
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $db_value<br/>Either a DB Value or an I2CE_FormField
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $db_value<br/>Either a DB Value or an I2CE_FormField
===create_DOMEditable_list()===
===create_DOMEditable_list()===
Creates a drop down list of options.
Creates a drop down list of options.
@pararm array $fields
@pararm array $fields
*Signature: protected function create_DOMEditable_list($node,$template,$form_node,$fields,$forms,$limits)
*Signature: protected function create_DOMEditable_list($node,$template,$form_node,$fields,$forms,$limits)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] DOMNode or an array of DOMNodes to add.
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] DOMNode or an array of DOMNodes to add.
Parameters:
Parameters:
* [http://www.php.net/manual/en/class.domnode.php domnode] $node<br/>the node we wish to add the drop down list under
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node<br/>the node we wish to add the drop down list under
* [[Class: I2CE_Template | I2CE_Template]] $template
* [[Class: I2CE_Template | I2CE_Template]] $template
*$form_node  
*$form_node  
*$fields  
*$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 ] $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
* [http://www.php.net/manual/en/language.types.array.php array ] $limits<br/>An array, indexed by form name, of limiting data
===getComponentizedValue()===
===getComponentizedValue()===
Componentizes the given $db_value based on component
Componentizes the given $db_value based on component
*Signature: public function getComponentizedValue($db_value,$forms,$component)
*Signature: public function getComponentizedValue($db_value,$forms,$component)
*Returns: [http://www.php.net/manual/en/language.types.string.php string] The componentized db_value
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] The componentized db_value
Parameters:
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.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.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
* [http://www.php.net/manual/en/language.types.string.php string ] $component<br/>The component we wish to encode
===getDBValue()===
===getDBValue()===
*Signature: public function getDBValue()
*Signature: public function getDBValue()
Line 45: Line 46:
Return the default display style for this mapped field.
Return the default display style for this mapped field.
*Signature: public function getDefaultDisplayStyle($type)
*Signature: public function getDefaultDisplayStyle($type)
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $type
* [http://www.php.net/manual/en/language.types.string.php string ] $type
===getDisplayNode()===
===getDisplayNode()===
Return the display value of this form field as a DOM Node.
Return the display value of this form field as a DOM Node.
*Signature: public function getDisplayNode($node,$template)
*Signature: public function getDisplayNode($node,$template)
*Returns: [http://www.php.net/manual/en/class.domnode.php DOMNode]
*Returns: [http://www.php.net/manual/en/class.domnode.php DOMNode ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/class.domnode.php domnode] $node
* [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node
* [[Class: I2CE_Template | I2CE_Template]] $template
* [[Class: I2CE_Template | I2CE_Template]] $template
===getDisplayValue()===
===getDisplayValue()===
Line 59: Line 60:
entry for this field.
entry for this field.
*Signature: public function getDisplayValue($entry,$number_format)
*Signature: public function getDisplayValue($entry,$number_format)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed]
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
Parameters:
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
* [[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
**Default Value: false
**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.
* [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  
**Default Value: false  
===getDisplayedFields()===
===getDisplayedFields()===
Line 69: Line 70:
can only select the current field.
can only select the current field.
*Signature: public function getDisplayedFields($display)
*Signature: public function getDisplayedFields($display)
*Returns: [http://www.php.net/manual/en/language.types.array.php array]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $display
* [http://www.php.net/manual/en/language.types.string.php string ] $display
**Default Value: 'default'  
**Default Value: 'default'  
===getDisplayedStyle()===
===getDisplayedStyle()===
Line 77: Line 78:
CURRENCT field can only have one option so ignore anything given.
CURRENCT field can only have one option so ignore anything given.
*Signature: public function getDisplayedStyle($display)
*Signature: public function getDisplayedStyle($display)
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $display
* [http://www.php.net/manual/en/language.types.string.php string ] $display
**Default Value: 'default'  
**Default Value: 'default'  
===getFormLimits()===
===getFormLimits()===
Line 85: Line 86:
form limits for now.
form limits for now.
*Signature: public function getFormLimits($type)
*Signature: public function getFormLimits($type)
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $type
* [http://www.php.net/manual/en/language.types.string.php string ] $type
**Default Value: 'default'  
**Default Value: 'default'  
===getFromDB()===
===getFromDB()===
Line 94: Line 95:
*Signature: public function getFromDB($value)
*Signature: public function getFromDB($value)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $value
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
===getSQLComponentization()===
===getSQLComponentization()===
Componentizes the given $db_value based on component
Componentizes the given $db_value based on component
*Signature: public function getSQLComponentization($db_ref,$forms,$component)
*Signature: public function getSQLComponentization($db_ref,$forms,$component)
*Returns: [http://www.php.net/manual/en/language.types.string.php string] The componentized db_value
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] The componentized db_value
Parameters:
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.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.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
* [http://www.php.net/manual/en/language.types.string.php string ] $component<br/>The component we wish to encode
===getSelectableForms()===
===getSelectableForms()===
Return the selectable forms for this field.  CURRENCY field types
Return the selectable forms for this field.  CURRENCY field types
can only select "currency" forms.
can only select "currency" forms.
*Signature: public function getSelectableForms()
*Signature: public function getSelectableForms()
*Returns: [http://www.php.net/manual/en/language.types.array.php array]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
===getValue()===
===getValue()===
*Signature: public function getValue()
*Signature: public function getValue()
Line 113: Line 114:
Checks to see if the current value for this is set and valid.
Checks to see if the current value for this is set and valid.
*Signature: public function isValid()
*Signature: public function isValid()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===multiply()===
===multiply()===
Multiply the value of this field by the given value.
Multiply the value of this field by the given value.
Line 123: Line 124:
*Signature: public function setFromPost($post)
*Signature: public function setFromPost($post)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.array.php array] $post<br/>The $_POST array holding the values for this form.
* [http://www.php.net/manual/en/language.types.array.php array ] $post<br/>The $_POST array holding the values for this form.
==Inherited Variables==
==Inherited Variables==
===$name===
===$name===

Revision as of 21:24, 16 October 2009

This article desrcibes the class iHRIS_FormField_CURRENCY.

It is contained in the module Currency in the package iHRIS Common

The class is defined in the file: modules/Currency/lib/iHRIS_FormField_CURRENCY.php

@copyright Copyright © 2007, 2008 IntraHealth International, Inc. Class for defining all the database fields used by a {@link I2CE_Form} object.

  • Author: Luke Duncan <lduncan@intrahealth.org>
  • Since: v2.0.0

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)
  • Returns: -1,0,1

Parameters:

  • mixed $db_value
    Either a DB Value or an I2CE_FormField

create_DOMEditable_list()

Creates a drop down list of options. @pararm array $fields

  • Signature: protected function create_DOMEditable_list($node,$template,$form_node,$fields,$forms,$limits)
  • Returns: mixed DOMNode or an array of DOMNodes to add.

Parameters:

  • DOMNode $node
    the node we wish to add the drop down list under
  • 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

getComponentizedValue()

Componentizes the given $db_value based on component

  • Signature: public function getComponentizedValue($db_value,$forms,$component)
  • Returns: string The componentized db_value

Parameters:

  • string $db_value
    The non-componentized value
  • array $forms
    of stirng. The form names which we wish to componentize.
  • string $component
    The component we wish to encode

getDBValue()

  • Signature: public function getDBValue()

getDefaultDisplayStyle()

Return the default display style for this mapped field.

  • Signature: public function getDefaultDisplayStyle($type)
  • Returns: string

Parameters:

getDisplayNode()

Return the display value of this form field as a DOM Node.

  • Signature: public function getDisplayNode($node,$template)
  • Returns: DOMNode

Parameters:

getDisplayValue()

Returns the value of this field as a human readable format. entry for this field.

  • Signature: public function getDisplayValue($entry,$number_format)
  • Returns: mixed

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
    • Default Value: false
  • boolean $number_format
    If true, call number_format on the returned value.
    • Default Value: false

getDisplayedFields()

Return the displayed fields for this field. CURRENCY field types can only select the current field.

  • Signature: public function getDisplayedFields($display)
  • Returns: array

Parameters:

  • string $display
    • Default Value: 'default'

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)
  • Returns: string

Parameters:

  • string $display
    • Default Value: 'default'

getFormLimits()

Return the form limits for this field. CURRENCY doesn't support form limits for now.

  • Signature: public function getFormLimits($type)
  • Returns: string

Parameters:

  • string $type
    • Default Value: 'default'

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:

getSQLComponentization()

Componentizes the given $db_value based on component

  • Signature: public function getSQLComponentization($db_ref,$forms,$component)
  • Returns: string The componentized db_value

Parameters:

  • string $db_ref
    The reference to the data
  • array $forms
    of stirng. The form names which we wish to componentize.
  • string $component
    The component we wish to encode

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.

Inherited Variables

$name

Theis protected variable is inherited from I2CE_FormField->$name

$options

Theis protected variable is inherited from I2CE_FormField->$options

$value

Theis protected variable is inherited from I2CE_FormField->$value

$headers

Theis protected variable is inherited from I2CE_FormField->$headers

$href

Theis protected variable is inherited from I2CE_FormField->$href

$form

Theis protected variable is inherited from I2CE_FormField->$form

$history

Theis protected variable is inherited from I2CE_FormField->$history

$history_idx

Theis protected variable is inherited from I2CE_FormField->$history_idx

$attributes

Theis protected variable is inherited from I2CE_FormField->$attributes

$invalid

Theis protected variable is inherited from I2CE_FormField->$invalid

Inherited Fuzzy Methods

generateLimit_in()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_in()

generateLimit_equals()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_equals()

generateLimit_greaterthan()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_greaterthan()

generateLimit_lessthan()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_lessthan()

generateLimit_greaterthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_greaterthan_equals()

generateLimit_lessthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_lessthan_equals()

generateLimit_between()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_between()

generateLimit_like()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_like()

generateLimit_lowerlike()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_lowerlike()

generateLimit_contains()

This method is inherited from I2CE_FormField_DB_STRING->generateLimit_contains()

checkLimit_in()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_in()

checkLimitString_in()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_in()

getLimitMenu_in()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_in()

processLimitMenu_in()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_in()

checkLimit_equals()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_equals()

checkLimitString_equals()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_equals()

getLimitMenu_equals()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_equals()

processLimitMenu_equals()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_equals()

checkLimit_greaterthan()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_greaterthan()

checkLimitString_greaterthan()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_greaterthan()

getLimitMenu_greaterthan()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_greaterthan()

processLimitMenu_greaterthan()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_greaterthan()

checkLimit_lessthan()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_lessthan()

checkLimitString_lessthan()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_lessthan()

getLimitMenu_lessthan()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_lessthan()

processLimitMenu_lessthan()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_lessthan()

checkLimit_greaterthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_greaterthan_equals()

checkLimitString_greaterthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_greaterthan_equals()

getLimitMenu_greaterthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_greaterthan_equals()

processLimitMenu_greaterthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_greaterthan_equals()

checkLimit_lessthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_lessthan_equals()

checkLimitString_lessthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_lessthan_equals()

getLimitMenu_lessthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_lessthan_equals()

processLimitMenu_lessthan_equals()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_lessthan_equals()

checkLimit_between()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_between()

checkLimitString_between()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_between()

getLimitMenu_between()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_between()

processLimitMenu_between()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_between()

checkLimit_like()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_like()

checkLimitString_like()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_like()

getLimitMenu_like()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_like()

processLimitMenu_like()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_like()

checkLimit_lowerlike()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_lowerlike()

checkLimitString_lowerlike()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_lowerlike()

getLimitMenu_lowerlike()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_lowerlike()

processLimitMenu_lowerlike()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_lowerlike()

checkLimit_contains()

This method is inherited from I2CE_FormField_DB_STRING->checkLimit_contains()

checkLimitString_contains()

This method is inherited from I2CE_FormField_DB_STRING->checkLimitString_contains()

getLimitMenu_contains()

This method is inherited from I2CE_FormField_DB_STRING->getLimitMenu_contains()

processLimitMenu_contains()

This method is inherited from I2CE_FormField_DB_STRING->processLimitMenu_contains()

cachedTableReference()

This method is inherited from I2CE_FormField->cachedTableReference()

isNumeric()

This method is inherited from I2CE_FormField->isNumeric()

getLimitStyles()

This method is inherited from I2CE_FormField->getLimitStyles()

generateLimit()

This method is inherited from I2CE_FormField->generateLimit()

generateLimit_null()

This method is inherited from I2CE_FormField->generateLimit_null()

generateLimit_not_null()

This method is inherited from I2CE_FormField->generateLimit_not_null()

generateLimit_null_not_null()

This method is inherited from I2CE_FormField->generateLimit_null_not_null()

checkLimit_null()

This method is inherited from I2CE_FormField->checkLimit_null()

checkLimit_not_null()

This method is inherited from I2CE_FormField->checkLimit_not_null()

checkLimit_null_not_null()

This method is inherited from I2CE_FormField->checkLimit_null_not_null()

checkLimitString_null()

This method is inherited from I2CE_FormField->checkLimitString_null()

checkLimitString_not_null()

This method is inherited from I2CE_FormField->checkLimitString_not_null()

checkLimitString_null_not_null()

This method is inherited from I2CE_FormField->checkLimitString_null_not_null()

getLimitMenu_null()

This method is inherited from I2CE_FormField->getLimitMenu_null()

getLimitMenu_not_null()

This method is inherited from I2CE_FormField->getLimitMenu_not_null()

getLimitMenu_null_not_null()

This method is inherited from I2CE_FormField->getLimitMenu_null_not_null()

processLimitMenu_null()

This method is inherited from I2CE_FormField->processLimitMenu_null()

processLimitMenu_not_null()

This method is inherited from I2CE_FormField->processLimitMenu_not_null()

processLimitMenu_null_not_null()

This method is inherited from I2CE_FormField->processLimitMenu_null_not_null()

generateLimit_max_parent()

This method is inherited from I2CE_FormField->generateLimit_max_parent()

generateLimit_min_parent()

This method is inherited from I2CE_FormField->generateLimit_min_parent()

generateLimit_max_parent_form()

This method is inherited from I2CE_FormField->generateLimit_max_parent_form()

generateLimit_min_parent_form()

This method is inherited from I2CE_FormField->generateLimit_min_parent_form()

getLimitMenu_max_parent()

This method is inherited from I2CE_FormField->getLimitMenu_max_parent()

getLimitMenu_min_parent()

This method is inherited from I2CE_FormField->getLimitMenu_min_parent()

getLimitMenu_max_parent_form()

This method is inherited from I2CE_FormField->getLimitMenu_max_parent_form()

getLimitMenu_min_parent_form()

This method is inherited from I2CE_FormField->getLimitMenu_min_parent_form()

processLimitMenu_max_parent()

This method is inherited from I2CE_FormField->processLimitMenu_max_parent()

processLimitMenu_min_parent()

This method is inherited from I2CE_FormField->processLimitMenu_min_parent()

processLimitMenu_max_parent_form()

This method is inherited from I2CE_FormField->processLimitMenu_max_parent_form()

processLimitMenu_min_parent_form()

This method is inherited from I2CE_FormField->processLimitMenu_min_parent_form()

save()

This method is inherited from I2CE_FormField->save()

populateHistory()

This method is inherited from I2CE_FormField->populateHistory()

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()