Class: iHRIS FormField CURRENCY

From IHRIS Wiki
Revision as of 12:11, 19 October 2009 by Litlfred (talk | contribs)

This article describes the class iHRIS_FormField_CURRENCY.

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

getDisplayNode()

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

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
  • 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'
  • 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'
  • 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'
  • 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:

getSQLComponentization()

Componentizes the given $db_value based on component

  • Signature: public function getSQLComponentization($db_ref,$forms,$component)
  • 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
  • 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.