Class: I2CE FormField MAP

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

This article describes the class I2CE_FormField_MAP.

Class for defining all the database fields used by a object.

Methods

checkStyle_tree()

Check to see if the tree style is allowed.

  • Signature: public function checkStyle_tree()
  • Returns: boolean

create_DOMEditable_list()

Creates a drop down list of options.

  • Signature: protected function create_DOMEditable_list($node,$template,$form_node,$fields,$forms,$limits,$orders)
  • 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
    • array $orders
      An array, indexed by form name, of ordering data
  • Returns: mixed
    DOMNode or an array of DOMNodes to add.

create_DOMEditable_tree()

Creates a selectable auto-suggest tree view of the options

  • Signature: protected function create_DOMEditable_tree($node,$template,$form_node,$fields,$forms,$limits,$orders)
  • Parameters:
    • DOMNode $node
      the node that requested this drop down @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
    • array $orders
      An array, indexed by form name, of ordering 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()

Return the DB value for this form field.

  • Signature: public function getDBValue()
  • Returns: string

getDefaultDisplayStyle()

  • Signature: public function getDefaultDisplayStyle($type)
  • Parameters:
    • $type

getDisplayValue()

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

  • Signature: public function getDisplayValue($entry)
  • 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
  • Returns: mixed

getFromDB()

Return the value of this field from the database format for the given type.

  • Signature: public function getFromDB($value)
  • Parameters:

getMappedForm()

Get the form that this field maps to

  • Signature: public function getMappedForm()
  • Returns: string.

getMappedID()

Get the id of the form that this field maps to If not set, returns 0.

  • Signature: public function getMappedID()
  • Returns: string

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

getValue()

Return the native value for this form field.

  • Signature: public function getValue()
  • Returns: array

isValid()

Checks to see if the current value for this is set and valid.

  • Signature: public function isValid()
  • Returns: boolean

issetValue()

Checks to see if the value has been set.

  • Signature: public function issetValue()
  • Returns: boolean

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.