Class: I2CE FormField: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
This article desrcibes the1 class '''I2CE_FormField''' | This article desrcibes the1 class '''I2CE_FormField'''. | ||
*Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]]. | |||
It is contained in the module [[iHRIS Module List#forms|forms]] in the package [https://launchpad.net/i2ce I2CE] | It is contained in the module [[iHRIS Module List#forms|forms]] in the package [https://launchpad.net/i2ce I2CE] | ||
Line 28: | Line 29: | ||
===$value=== | ===$value=== | ||
The value of this field. | The value of this field. | ||
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed] $value | *Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value | ||
===$headers=== | ===$headers=== | ||
Line 57: | Line 58: | ||
error messages to be displayed when a form is invalid. | error messages to be displayed when a form is invalid. | ||
. string or array of "extra" {@link setInvalid} | . string or array of "extra" {@link setInvalid} | ||
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed] $invalid | *Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $invalid | ||
==Methods== | ==Methods== | ||
Line 65: | Line 66: | ||
*Signature: public function __construct($name,$options) | *Signature: public function __construct($name,$options) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $name | * [http://www.php.net/manual/en/language.types.string.php string ] $name | ||
* [http://www.php.net/manual/en/language.types.array.php array] $options<br/>A list of options for this form field. The keys used are: in_db, required, | * [http://www.php.net/manual/en/language.types.array.php array ] $options<br/>A list of options for this form field. The keys used are: in_db, required, | ||
**Default Value: array() | **Default Value: array() | ||
===addHistory()=== | ===addHistory()=== | ||
Line 78: | Line 79: | ||
*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 | ||
===createField()=== | ===createField()=== | ||
Instantiantiate a field given its short class name | Instantiantiate a field given its short class name | ||
*Signature: static public function createField($formfield,$name,$args) | *Signature: static public function createField($formfield,$name,$args) | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] I2CE_FormField or false on failure | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] I2CE_FormField or false on failure | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $formfield<br/>the short name of a form field (e.g. STRING_LINE or DATE_YMD) | * [http://www.php.net/manual/en/language.types.string.php string ] $formfield<br/>the short name of a form field (e.g. STRING_LINE or DATE_YMD) | ||
* [http://www.php.net/manual/en/language.types.string.php string] $name<br/>The name of the field | * [http://www.php.net/manual/en/language.types.string.php string ] $name<br/>The name of the field | ||
* [http://www.php.net/manual/en/language.types.array.php array] $args<br/>Defaults to empty array. The field arguments passed to the constructor | * [http://www.php.net/manual/en/language.types.array.php array ] $args<br/>Defaults to empty array. The field arguments passed to the constructor | ||
**Default Value: array() | **Default Value: array() | ||
===displayInvalid()=== | ===displayInvalid()=== | ||
Line 103: | Line 104: | ||
Return the attribute value for a given attribute. | Return the attribute value for a given attribute. | ||
*Signature: public function getAttribute($key) | *Signature: public function getAttribute($key) | ||
*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: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $key | * [http://www.php.net/manual/en/language.types.string.php string ] $key | ||
===getDBType()=== | ===getDBType()=== | ||
Return the DB field type for this type. | Return the DB field type for this type. | ||
*Signature: public function getDBType() | *Signature: public function getDBType() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getDBValue()=== | ===getDBValue()=== | ||
Returns the value of this field ready to be stored in the database. | Returns the value of this field ready to be stored in the database. | ||
*Signature: public function getDBValue() | *Signature: public function getDBValue() | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] | ||
===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 | * [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 125: | Line 126: | ||
entry for this field. | entry for this field. | ||
*Signature: public function getDisplayValue($entry) | *Signature: public function getDisplayValue($entry) | ||
*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 | ||
Line 132: | Line 133: | ||
Get the display styles registered for this form field. Will always include 'default' | Get the display styles registered for this form field. Will always include 'default' | ||
*Signature: public function getDisplays() | *Signature: public function getDisplays() | ||
*Returns: [http://www.php.net/manual/en/language.types.array.php array] | *Returns: [http://www.php.net/manual/en/language.types.array.php array ] | ||
===getElement()=== | ===getElement()=== | ||
*Signature: protected function getElement() | *Signature: protected function getElement() | ||
Line 142: | Line 143: | ||
*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 | ||
===getHTMLName()=== | ===getHTMLName()=== | ||
Return the value for the name attribute to be used for this field in a form. | Return the value for the name attribute to be used for this field in a form. | ||
*Signature: public function getHTMLName($prefix) | *Signature: public function getHTMLName($prefix) | ||
*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: | ||
*$prefix | *$prefix | ||
Line 154: | Line 155: | ||
*Signature: public function getHeader($type) | *Signature: public function getHeader($type) | ||
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" | ||
===getHref()=== | ===getHref()=== | ||
Return the URL to be used as a link for this field for display. | Return the URL to be used as a link for this field for display. | ||
*Signature: public function getHref() | *Signature: public function getHref() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getInvalid()=== | ===getInvalid()=== | ||
Return the invalid information. | Return the invalid information. | ||
*Signature: public function getInvalid() | *Signature: public function getInvalid() | ||
*Returns: [http://www.php.net/manual/en/language.types.array.php array] | *Returns: [http://www.php.net/manual/en/language.types.array.php array ] | ||
===getMDB2Type()=== | ===getMDB2Type()=== | ||
Return the MDB2 field type for this field. | Return the MDB2 field type for this field. | ||
If it isn't set return the DB type. | If it isn't set return the DB type. | ||
*Signature: public function getMDB2Type() | *Signature: public function getMDB2Type() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getName()=== | ===getName()=== | ||
Returns the field name of this field. | Returns the field name of this field. | ||
*Signature: public function getName() | *Signature: public function getName() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getOption()=== | ===getOption()=== | ||
Get the value stored at a named option exists | Get the value stored at a named option exists | ||
*Signature: public function getOption($option) | *Signature: public function getOption($option) | ||
*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: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $option | * [http://www.php.net/manual/en/language.types.string.php string ] $option | ||
===getOptionsByPath()=== | ===getOptionsByPath()=== | ||
*Signature: protected function getOptionsByPath($path) | *Signature: protected function getOptionsByPath($path) | ||
Line 187: | Line 188: | ||
Return the type string for this field. | Return the type string for this field. | ||
*Signature: public function getString() | *Signature: public function getString() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getTypeString()=== | ===getTypeString()=== | ||
Return the string name for a given type. | Return the string name for a given type. | ||
*Signature: public function getTypeString() | *Signature: public function getTypeString() | ||
*Returns: [http://www.php.net/manual/en/language.types.string.php string] | *Returns: [http://www.php.net/manual/en/language.types.string.php string ] | ||
===getValue()=== | ===getValue()=== | ||
Returns the value of this field. | Returns the value of this field. | ||
*Signature: public function getValue() | *Signature: public function getValue() | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] | ||
===hasAttribute()=== | ===hasAttribute()=== | ||
Return true if a given attribute exists for this form. | Return true if a given attribute exists for this form. | ||
Line 201: | Line 202: | ||
*Returns: boolean; | *Returns: boolean; | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $key | * [http://www.php.net/manual/en/language.types.string.php string ] $key | ||
===hasDisplay()=== | ===hasDisplay()=== | ||
Checks to see if the given display type is registed for this form field. | Checks to see if the given display type is registed for this form field. | ||
*Signature: public function hasDisplay($type) | *Signature: public function hasDisplay($type) | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $type<br/>The display type. 'default' always returns true | * [http://www.php.net/manual/en/language.types.string.php string ] $type<br/>The display type. 'default' always returns true | ||
===hasHeader()=== | ===hasHeader()=== | ||
Check to see if the given header type exists | Check to see if the given header type exists | ||
*Signature: public function hasHeader($type) | *Signature: public function hasHeader($type) | ||
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" | ||
===hasInvalid()=== | ===hasInvalid()=== | ||
Checks to see if there are any entries in the {@link invalid} array. | Checks to see if there are any entries in the {@link invalid} array. | ||
*Signature: public function hasInvalid() | *Signature: public function hasInvalid() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===hasNextHistory()=== | ===hasNextHistory()=== | ||
Check to see if there are remaining DBEntry elements in {@link history} array. | Check to see if there are remaining DBEntry elements in {@link history} array. | ||
*Signature: public function hasNextHistory() | *Signature: public function hasNextHistory() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===hasOption()=== | ===hasOption()=== | ||
Check if a named option exists | Check if a named option exists | ||
*Signature: public function hasOption($option) | *Signature: public function hasOption($option) | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
* | * | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $option | * [http://www.php.net/manual/en/language.types.string.php string ] $option | ||
===isInDB()=== | ===isInDB()=== | ||
Checks to see if this field is saved in the database. | Checks to see if this field is saved in the database. | ||
*Signature: public function isInDB() | *Signature: public function isInDB() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===isSameValue()=== | ===isSameValue()=== | ||
Check to see if the given DB value is equivalent to this value. | Check to see if the given DB value is equivalent to this value. | ||
*Signature: public function isSameValue($db_value) | *Signature: public function isSameValue($db_value) | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
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 | ||
===isValid()=== | ===isValid()=== | ||
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: abstract public function isValid() | *Signature: abstract 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 ] | ||
===issetValue()=== | ===issetValue()=== | ||
Checks to see if the value has been set. | Checks to see if the value has been set. | ||
*Signature: public function issetValue() | *Signature: public function issetValue() | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] | ||
===nextHistory()=== | ===nextHistory()=== | ||
Return the next DBEntry element from the {@link history} array. | Return the next DBEntry element from the {@link history} array. | ||
Line 259: | Line 260: | ||
*Signature: public function processDOM($node,$template) | *Signature: public function processDOM($node,$template) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/class.domnode.php | * [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node | ||
* [[Class: I2CE_Template | I2CE_Template]] $template | * [[Class: I2CE_Template | I2CE_Template]] $template | ||
===processDOMEditable()=== | ===processDOMEditable()=== | ||
*Signature: abstract public function processDOMEditable($node,$template,$form_node) | *Signature: abstract public function processDOMEditable($node,$template,$form_node) | ||
*Returns: [http://www.php.net/manual/en/language.types.array.php array] of DOMNode | *Returns: [http://www.php.net/manual/en/language.types.array.php array ] of DOMNode | ||
Parameters: | Parameters: | ||
*$node | *$node | ||
Line 271: | Line 272: | ||
*Signature: public function processDOMNotEditable($node,$template,$form_node) | *Signature: public function processDOMNotEditable($node,$template,$form_node) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/class.domnode.php | * [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node | ||
* [[Class: I2CE_Template | I2CE_Template]] $template | * [[Class: I2CE_Template | I2CE_Template]] $template | ||
* [http://www.php.net/manual/en/class.domnode.php | * [http://www.php.net/manual/en/class.domnode.php DOMNode ] $form_node | ||
===setAttribute()=== | ===setAttribute()=== | ||
Set an attribute for this form. | Set an attribute for this form. | ||
*Signature: public function setAttribute($key,$value) | *Signature: public function setAttribute($key,$value) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $key | * [http://www.php.net/manual/en/language.types.string.php string ] $key | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $value | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value | ||
===setElement()=== | ===setElement()=== | ||
*Signature: protected function setElement($element) | *Signature: protected function setElement($element) | ||
Line 293: | Line 294: | ||
*Signature: public function setFromDB($value) | *Signature: public function setFromDB($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 | ||
===setFromPost()=== | ===setFromPost()=== | ||
Sets the value of this field from the posted form. | Sets the value of this field from the posted form. | ||
*Signature: public function setFromPost($post) | *Signature: public function setFromPost($post) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $post | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $post | ||
===setHeaders()=== | ===setHeaders()=== | ||
Set the headers for this form field. | Set the headers for this form field. | ||
*Signature: public function setHeaders($headers) | *Signature: public function setHeaders($headers) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.array.php array] $headers | * [http://www.php.net/manual/en/language.types.array.php array ] $headers | ||
===setHref()=== | ===setHref()=== | ||
Set the URL for this field | Set the URL for this field | ||
*Signature: public function setHref($href) | *Signature: public function setHref($href) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $href | * [http://www.php.net/manual/en/language.types.string.php string ] $href | ||
===setInvalid()=== | ===setInvalid()=== | ||
Add or replace an entry in the {@link invalid} array. | Add or replace an entry in the {@link invalid} array. | ||
Line 317: | Line 318: | ||
*Signature: public function setInvalid($message,$extra) | *Signature: public function setInvalid($message,$extra) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $message<br/>The error message to display. | * [http://www.php.net/manual/en/language.types.string.php string ] $message<br/>The error message to display. | ||
* [http://www.php.net/manual/en/language.types.array.php array] $extra<br/>Any extra information to be formatted and displayed. | * [http://www.php.net/manual/en/language.types.array.php array ] $extra<br/>Any extra information to be formatted and displayed. | ||
**Default Value: null | **Default Value: null | ||
===setValue()=== | ===setValue()=== | ||
Line 324: | Line 325: | ||
*Signature: public function setValue($value) | *Signature: public function setValue($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 | ||
===unsetValue()=== | ===unsetValue()=== | ||
Unsets the value of this field. | Unsets the value of this field. |
Revision as of 22:26, 16 October 2009
This article desrcibes the1 class I2CE_FormField.
- Extends the class: I2CE_Fuzzy.
It is contained in the module forms in the package I2CE
The class is defined in the file: modules/Forms/lib/I2CE_FormField.php
Class for defining all the database fields used by a {@link I2CE_Form} object.
- Author: Luke Duncan <lduncan@intrahealth.org>
- Since: v2.0.0
Constants
I2CE_FormField::FIELD_TYPE_I2CE
A string type for the field Defined as: "string"
I2CE_FormField::FIELD_TYPE_DB
The database type for the field Defined as: "varchar( 255 ) COLLATE utf8_bin default NULL"
I2CE_FormField::FIELD_TYPE_MDB2
The MDB2 type for the field. Defined as: "text"
Variables
$name
The name of this field.
- Type: protected ng $name
$options
An associative array with all the options for this form field.
- Type: protected y $options
$value
The value of this field.
- Type: protected mixed $value
$headers
A list of headers for this form field.
- Type: protected y $headers
$href
A URL to be used as a link for this field when displaying the value.
- Type: protected ng $href
$form
A reference to the form object this field is a part of.
- Type: protected I2CE_Form $form
$history
A list of {@link I2CE_Entry} objects for all entries for this field.
- Type: protected y $history
$history_idx
The index for cycling through all historical entries.
- Type: protected nteger $history_idx
$attributes
A list of attributes for this FormField instance.
- Type: protected y $attributes
$invalid
error messages to be displayed when a form is invalid. . string or array of "extra" {@link setInvalid}
- Type: protected mixed $invalid
Methods
__construct()
Create a new instance of a I2CE_FormField unique and unique_field
- Signature: public function __construct($name,$options)
Parameters:
- string $name
- array $options
A list of options for this form field. The keys used are: in_db, required,- Default Value: array()
addHistory()
Add a history entry to this field.
- Signature: public function addHistory($entry)
Parameters:
- I2CE_Entry $entry
The historical entry
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
createField()
Instantiantiate a field given its short class name
- Signature: static public function createField($formfield,$name,$args)
- Returns: mixed I2CE_FormField or false on failure
Parameters:
- string $formfield
the short name of a form field (e.g. STRING_LINE or DATE_YMD) - string $name
The name of the field - array $args
Defaults to empty array. The field arguments passed to the constructor- Default Value: array()
displayInvalid()
Displays invalid/error messages on the given node @var I2CE_Template $template @var DOMNode $node
- Signature: protected function displayInvalid($template,$node)
Parameters:
- $template
- $node
firstHistory()
Reset the {@link history_idx history index} and return the first element
- Signature: public function firstHistory()
- Returns: DBEntry
getAttribute()
Return the attribute value for a given attribute.
- Signature: public function getAttribute($key)
- Returns: mixed
Parameters:
- string $key
getDBType()
Return the DB field type for this type.
- Signature: public function getDBType()
- Returns: string
getDBValue()
Returns the value of this field ready to be stored in the database.
- Signature: public function getDBValue()
- Returns: mixed
getDisplayNode()
Return the display value of this form field as a DOM Node.
- Signature: public function getDisplayNode($node,$template)
- Returns: DOMNode
Parameters:
- DOMNode $node
- I2CE_Template $template
getDisplayValue()
Returns the value of this field as a human readable format. entry for this field.
- Signature: public function getDisplayValue($entry)
- 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
getDisplays()
Get the display styles registered for this form field. Will always include 'default'
- Signature: public function getDisplays()
- Returns: array
getElement()
- Signature: protected function getElement()
getForm()
Returns the form object for this field.
- Signature: public function getForm()
getFromDB()
Return the value of this field from the database format for the given type
- Signature: public function getFromDB($value)
Parameters:
- mixed $value
getHTMLName()
Return the value for the name attribute to be used for this field in a form.
- Signature: public function getHTMLName($prefix)
- Returns: string
Parameters:
- $prefix
- Default Value: 'fields'
getHeader()
Return the given header by type
- Signature: public function getHeader($type)
Parameters:
- string $type
- Default Value: "default"
getHref()
Return the URL to be used as a link for this field for display.
- Signature: public function getHref()
- Returns: string
getInvalid()
Return the invalid information.
- Signature: public function getInvalid()
- Returns: array
getMDB2Type()
Return the MDB2 field type for this field. If it isn't set return the DB type.
- Signature: public function getMDB2Type()
- Returns: string
getName()
Returns the field name of this field.
- Signature: public function getName()
- Returns: string
getOption()
Get the value stored at a named option exists
- Signature: public function getOption($option)
- Returns: mixed
Parameters:
- string $option
getOptionsByPath()
- Signature: protected function getOptionsByPath($path)
Parameters:
- $path
getString()
Return the type string for this field.
- Signature: public function getString()
- Returns: string
getTypeString()
Return the string name for a given type.
- Signature: public function getTypeString()
- Returns: string
getValue()
Returns the value of this field.
- Signature: public function getValue()
- Returns: mixed
hasAttribute()
Return true if a given attribute exists for this form.
- Signature: public function hasAttribute($key)
- Returns: boolean;
Parameters:
- string $key
hasDisplay()
Checks to see if the given display type is registed for this form field.
- Signature: public function hasDisplay($type)
- Returns: boolean
Parameters:
- string $type
The display type. 'default' always returns true
hasHeader()
Check to see if the given header type exists
- Signature: public function hasHeader($type)
Parameters:
- string $type
- Default Value: "default"
hasInvalid()
Checks to see if there are any entries in the {@link invalid} array.
- Signature: public function hasInvalid()
- Returns: boolean
hasNextHistory()
Check to see if there are remaining DBEntry elements in {@link history} array.
- Signature: public function hasNextHistory()
- Returns: boolean
hasOption()
Check if a named option exists
- Signature: public function hasOption($option)
- Returns: boolean
Parameters:
- string $option
isInDB()
Checks to see if this field is saved in the database.
- Signature: public function isInDB()
- Returns: boolean
isSameValue()
Check to see if the given DB value is equivalent to this value.
- Signature: public function isSameValue($db_value)
- Returns: boolean
Parameters:
- mixed $db_value
Either a DB Value or an I2CE_FormField
isValid()
Checks to see if the current value for this is set and valid.
- Signature: abstract public function isValid()
- Returns: boolean
issetValue()
Checks to see if the value has been set.
- Signature: public function issetValue()
- Returns: boolean
nextHistory()
Return the next DBEntry element from the {@link history} array.
- Signature: public function nextHistory()
- Returns: DBEntry
optionsHasPath()
- Signature: protected function optionsHasPath($path)
Parameters:
- $path
processDOM()
Process this form field as a DOM element to place it in the template at the given node.
- Signature: public function processDOM($node,$template)
Parameters:
- DOMNode $node
- I2CE_Template $template
processDOMEditable()
- Signature: abstract public function processDOMEditable($node,$template,$form_node)
- Returns: array of DOMNode
Parameters:
- $node
- $template
- $form_node
processDOMNotEditable()
- Signature: public function processDOMNotEditable($node,$template,$form_node)
Parameters:
- DOMNode $node
- I2CE_Template $template
- DOMNode $form_node
setAttribute()
Set an attribute for this form.
- Signature: public function setAttribute($key,$value)
Parameters:
setElement()
- Signature: protected function setElement($element)
Parameters:
- $element
setForm()
Sets the form object for this field.
- Signature: public function setForm($form)
Parameters:
- I2CE_Form $form
setFromDB()
Sets the value of this field from the database format.
- Signature: public function setFromDB($value)
Parameters:
- mixed $value
setFromPost()
Sets the value of this field from the posted form.
- Signature: public function setFromPost($post)
Parameters:
- mixed $post
setHeaders()
Set the headers for this form field.
- Signature: public function setHeaders($headers)
Parameters:
- array $headers
setHref()
Set the URL for this field
- Signature: public function setHref($href)
Parameters:
- string $href
setInvalid()
Add or replace an entry in the {@link invalid} array.
The format for the $extra parameter is: array( "URL" => array( 'id' => 'display' ) ); The id value will be appended to the URL and the display part will be displayed as the link text.
- Signature: public function setInvalid($message,$extra)
Parameters:
- string $message
The error message to display. - array $extra
Any extra information to be formatted and displayed.- Default Value: null
setValue()
Sets the value of this field.
- Signature: public function setValue($value)
Parameters:
- mixed $value
unsetValue()
Unsets the value of this field.
- Signature: public function unsetValue()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()
Fuzzy Methods
cachedTableReference()
This method is implemented by I2CE_Module_CachedForms->cachedTableReference()
isNumeric()
This method is implemented by I2CE_Module_CustomReports->isNumericField()
getLimitStyles()
This method is implemented by I2CE_Module_FormLimits->getFieldLimitStyles()
generateLimit()
This method is implemented by I2CE_Module_FormLimits->generateFieldLimit()
generateLimit_null()
This method is implemented by I2CE_Module_FormLimits->generateLimit_null()
generateLimit_not_null()
This method is implemented by I2CE_Module_FormLimits->generateLimit_not_null()
generateLimit_null_not_null()
This method is implemented by I2CE_Module_FormLimits->generateLimit_not_null()
checkLimit_null()
This method is implemented by I2CE_Module_FormLimits->checkLimit_null()
checkLimit_not_null()
This method is implemented by I2CE_Module_FormLimits->checkLimit_not_null()
checkLimit_null_not_null()
This method is implemented by I2CE_Module_FormLimits->checkLimit_not_null()
checkLimitString_null()
This method is implemented by I2CE_Module_FormLimits->checkLimitString_null()
checkLimitString_not_null()
This method is implemented by I2CE_Module_FormLimits->checkLimitString_not_null()
checkLimitString_null_not_null()
This method is implemented by I2CE_Module_FormLimits->checkLimitString_not_null()
getLimitMenu_null()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_null()
getLimitMenu_not_null()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_not_null()
getLimitMenu_null_not_null()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_null_not_null()
processLimitMenu_null()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_null()
processLimitMenu_not_null()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_not_null()
processLimitMenu_null_not_null()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_null_not_null()
generateLimit_max_parent()
This method is implemented by I2CE_Module_FormLimits->generateLimit_max_parent()
generateLimit_min_parent()
This method is implemented by I2CE_Module_FormLimits->generateLimit_min_parent()
generateLimit_max_parent_form()
This method is implemented by I2CE_Module_FormLimits->generateLimit_max_parent_form()
generateLimit_min_parent_form()
This method is implemented by I2CE_Module_FormLimits->generateLimit_min_parent_form()
getLimitMenu_max_parent()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_max_parent()
getLimitMenu_min_parent()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_min_parent()
getLimitMenu_max_parent_form()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_max_parent_form()
getLimitMenu_min_parent_form()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_DISPLAYFIELDSTYLE_min_parent_form()
processLimitMenu_max_parent()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_max_parent()
processLimitMenu_min_parent()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_min_parent()
processLimitMenu_max_parent_form()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_max_parent_form()
processLimitMenu_min_parent_form()
This method is implemented by I2CE_Module_FormLimits->I2CE_FormField_PROCESSFIELDSTYLE_min_parent_form()
save()
This method is implemented by I2CE_FormStorage->FF_save()
populateHistory()
This method is implemented by I2CE_FormStorage->FF_populateHistory()