Class: I2CE FormField (4.1.12)
This article describes the abstract class I2CE_FormField .
- Extends the class: I2CE_Fuzzy.
- Child Classes:
- I2CE_FormField_DB_BLOB
- I2CE_FormField_DB_DATE
- I2CE_FormField_DB_INT
- I2CE_FormField_DB_STRING
- I2CE_FormField_DB_TEXT
- I2CE_FormField_DB_FLOAT
- Location: Part of the module Fields in the package I2CE 4.1.12-release
- Source: Defined in the file modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 31
- Author: Luke Duncan <lduncan@intrahealth.org>
- Since: v2.0.0
Class for defining all the database fields used by a object.
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.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 59
- Type: protected string $name
$options
An associative array with all the options for this form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 63
- Type: protected array $options
$value
The value of this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 67
- Type: protected mixed $value
$headers
A list of headers for this form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 71
- Type: protected array $headers
$href
A URL to be used as a link for this field when displaying the value.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 75
- Type: protected string $href
$container
A reference to the field conatiner object this field is a part of.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 79
- Type: protected I2CE_FieldContainer $container
$history
A list of objects for all entries for this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 83
- Type: protected array $history
$history_idx
The index for cycling through all historical entries.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 87
- Type: protected integer $history_idx
$attributes
A list of attributes for this FormField instance.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 91
- Type: protected array $attributes
$static_attrs
A list of static attributes for this FormField.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 96
- Type: static protected array $static_attrs
$invalid
error messages to be displayed when a form is invalid. . string or array of "extra" setInvalid
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 211
- Type: protected mixed $invalid
$HTMLName
The HTML Name for this form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 500
- Type: protected string $HTMLName
Methods
__construct()
Create a new instance of a I2CE_FormField
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 222
- Signature: public function __construct($name,$options)
- Parameters:
addHistory()
Add a history entry to this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 690
- Signature: public function addHistory($entry)
- Parameters:
- I2CE_Entry $entry
The historical entry
- I2CE_Entry $entry
cleanup()
Cleanup to remove circular references to container to field to container to field to container to field to cotainer to field
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 36
- Signature: public function cleanup()
compare()
Compares this form field agains the given form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 621
- Signature: public function compare($db_value)
- Parameters:
- mixed $db_value
Either a DB Value or an I2CE_FormField
- mixed $db_value
- Returns: -1,0,1
compareEntryDate()
Comparission function on the dates of two entrys
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 702
- Signature: static public function compareEntryDate($entry1,$entry2)
- Parameters:
- I2CE_Entry $entry1
- I2CE_Entry $entry2
- Returns: int
1,0,1
createField()
Instantiantiate a field given its short class name
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 107
- Signature: static public function createField($formfield,$name,$args)
- Parameters:
- Returns: mixed
I2CE_FormField or false on failure
displayInvalid()
Displays invalid/error messages on the given node @var I2CE_Template $template @var DOMNode $node
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1078
- Signature: protected function displayInvalid($template,$node)
- Parameters:
- $template
- $node
firstHistory()
Reset the history_idx history index and return the first element
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 731
- Signature: public function firstHistory()
- Returns: DBEntry
getAttribute()
Return the attribute value for a given attribute.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1147
- Signature: public function getAttribute($key)
- Parameters:
- string $key
- Returns: mixed
getContainer()
Returns the form object for this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 493
- Signature: public function getContainer()
getDBType()
Return the DB field type for this type.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 302
- Signature: public function getDBType()
- Returns: string
getDBValue()
Returns the value of this field ready to be stored in the database.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 579
- Signature: public function getDBValue()
- Returns: mixed
getDefaultValue()
Gets the default value from the field's data
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 273
- Signature: protected function getDefaultValue($fieldData)
- Parameters:
- array $fieldData
- Returns: array
where the first element is boolean (true if the has been a default value set, false otherwise) and the second element is the default value to be set.
getDisplayNode()
Return the display value of this form field as a DOM Node.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 798
- Signature: public function getDisplayNode($node,$template)
- Parameters:
- DOMNode $node
- I2CE_Template $template
- Returns: DOMNode
getDisplayValue()
Returns the value of this field as a human readable format.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 589
- Signature: public function getDisplayValue($entry,$style)
- 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
- $style
- Default Value: 'default'
- I2CE_Entry $entry
- Returns: mixed
getDisplays()
Get the display styles registered for this form field. Will always include 'default'
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 477
- Signature: public function getDisplays()
- Returns: array
getElement()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1114
- Signature: public function getElement()
getFromDB()
Return the value of this field from the database format for the given type
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 324
- 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.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 528
- Signature: public function getHTMLName($prefix)
- Parameters:
- $prefix
- Default Value: 'fields'
- $prefix
- Returns: string
getHeader()
Return the given header by type
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 677
- Signature: public function getHeader($type)
- Parameters:
- string $type
- Default Value: "default"
- string $type
getHistory()
Get the full history for this field. You may need to call populateHistory() before using this.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 750
- Signature: public function getHistory($as_array)
- Parameters:
- boolean $as_array
If true, return an associative array the history. Defaults to false in which case we return an array of entry.- Default Value: false
- boolean $as_array
- Returns: mixed.
getHref()
Return the URL to be used as a link for this field for display.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 784
- Signature: public function getHref()
- Returns: string
getInvalid()
Return the invalid information.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 203
- Signature: public function getInvalid()
- Returns: array
getMDB2Type()
Return the MDB2 field type for this field. If it isn't set return the DB type.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 311
- Signature: public function getMDB2Type()
- Returns: string
getName()
Returns the field name of this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 332
- Signature: public function getName()
- Returns: string
getOption()
Get the value stored at a named option exists
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 387
- Signature: public function getOption($option)
- Parameters:
- string $option
- Returns: mixed *
getOptionsByPath()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 439
- Signature: protected function getOptionsByPath($path)
- Parameters:
- $path
getStaticAttribute()
Return the static attribute value for a given attribute.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1185
- Signature: public function getStaticAttribute($key)
- Parameters:
- string $key
- Returns: mixed
getString()
Return the type string for this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 339
- Signature: public function getString()
- Returns: string
getTypeString()
Return the string name for a given type.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 294
- Signature: public function getTypeString()
- Returns: string
getValue()
Returns the value of this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 571
- Signature: public function getValue()
- Returns: mixed
hasAttribute()
Return true if a given attribute exists for this form.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1160
- Signature: public function hasAttribute($key)
- Parameters:
- string $key
- Returns: boolean;
hasDisplay()
Checks to see if the given display type is registed for this form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 462
- Signature: public function hasDisplay($type)
- Parameters:
- string $type
The display type. 'default' always returns true
- string $type
- Returns: boolean
hasHeader()
Check to see if the given header type exists
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 670
- Signature: public function hasHeader($type)
- Parameters:
- string $type
- Default Value: "default"
- string $type
hasInvalid()
Checks to see if there are any entries in the invalid array.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 188
- Signature: public function hasInvalid()
- Returns: boolean
hasNextHistory()
Check to see if there are remaining DBEntry elements in history array.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 719
- Signature: public function hasNextHistory()
- Returns: boolean
hasOption()
Check if a named option exists
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 355
- Signature: public function hasOption($option)
- Parameters:
- string $option
- Returns: boolean *
hasStaticAttribute()
Return true if a given static attribute exists for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1201
- Signature: public function hasStaticAttribute($key)
- Parameters:
- string $key
- Returns: boolean;
isInDB()
Checks to see if this field is saved in the database.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 346
- Signature: public function isInDB()
- Returns: boolean
isSameValue()
Check to see if the given DB value is equivalent to this value.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 603
- Signature: public function isSameValue($db_value)
- Parameters:
- mixed $db_value
Either a DB Value or an I2CE_FormField
- mixed $db_value
- Returns: boolean
isValid()
Checks to see if the current value for this is set and valid.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 637
- Signature: abstract public function isValid()
- Returns: boolean
issetValue()
Checks to see if the value has been set.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 644
- Signature: public function issetValue()
- Returns: boolean
nextHistory()
Return the next DBEntry element from the history array.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 740
- Signature: public function nextHistory()
- Returns: DBEntry
optionsHasPath()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 418
- Signature: protected function optionsHasPath($path)
- Parameters:
- $path
postprocessDOMEditable()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1128
- Signature: public function postprocessDOMEditable($node,$template,$form_node)
- Parameters:
- $node
- $template
- $form_node
processDOM()
Process this form field as a DOM element to place it in the template at the given node.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 829
- Signature: public function processDOM($node,$template)
- Parameters:
- DOMNode $node
- I2CE_Template $template
processDOMEditable()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1125
- Signature: abstract public function processDOMEditable($node,$template,$form_node)
- Parameters:
- $node
- $template
- $form_node
- Returns: array
of DOMNode
processDOMNotEditable()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1062
- Signature: public function processDOMNotEditable($node,$template,$form_node)
- Parameters:
- DOMNode $node
- I2CE_Template $template
- DOMNode $form_node
processHeaderEditable()
Process the header of an editable node
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1046
- Signature: protected function processHeaderEditable($template,$node,$head_node)
- Parameters:
- I2CE_Template $template
- DOMNode $node
- DOMNode $head_node
setAttribute()
Set an attribute for this form.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1138
- Signature: public function setAttribute($key,$value)
- Parameters:
setContainer()
Sets the field container object for this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 410
- Signature: public function setContainer($container)
- Parameters:
- I2CE_FieldContainer $container
setDefaultOptions()
Sets the default options, headers etc. from the field data
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 246
- Signature: public function setDefaultOptions($fieldData)
- Parameters:
- arary $fieldData
setElement()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1118
- Signature: public function setElement($element)
- Parameters:
- $element
setFromDB()
Sets the value of this field from the database format.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 555
- Signature: public function setFromDB($value)
- Parameters:
- mixed $value
setFromPost()
Sets the value of this field from the posted form.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 563
- Signature: public function setFromPost($post)
- Parameters:
- mixed $post
setHTMLName()
Set the HTML Name for this form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 506
- Signature: public function setHTMLName($name,$prefix)
- Parameters:
- string $name
- Default Value:
- $prefix
- Default Value: 'fields'
- string $name
setHeaders()
Set the headers for this form field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 659
- Signature: public function setHeaders($headers)
- Parameters:
- array $headers
setHref()
Set the URL for this field
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 776
- Signature: public function setHref($href)
- Parameters:
- string $href
setInvalid()
Add or replace an entry in the 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.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 138
- Signature: public function setInvalid($message,$extra)
- Parameters:
setInvalidMessage()
Sets an invalid message on a form field
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 155
- Signature: public function setInvalidMessage($messageName,$extra,$additional_message)
- Parameters:
setOption()
set a named option exists
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 363
- Signature: public function setOption($option,$val)
- Parameters:
setStaticAttribute()
Set a static attribute for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 1169
- Signature: public function setStaticAttribute($key,$value)
- Parameters:
setValue()
Sets the value of this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 548
- Signature: public function setValue($value)
- Parameters:
- mixed $value
unsetValue()
Unsets the value of this field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 650
- Signature: public function unsetValue()
withinForm()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 810
- Signature: protected function withinForm($node)
- Parameters:
- $node
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
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_FieldLimits->getFieldLimitStyles()
generateLimit()
This method is implemented by I2CE_Module_FieldLimits->generateFieldLimit()
describeLimit()
This method is implemented by I2CE_Module_FieldLimits->describeFieldLimit()
generateLimit_null()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_null()
generateLimit_not_null()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_not_null()
generateLimit_null_not_null()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_not_null()
checkLimit_null()
This method is implemented by I2CE_Module_FieldLimits->checkLimit_null()
checkLimit_not_null()
This method is implemented by I2CE_Module_FieldLimits->checkLimit_not_null()
checkLimit_null_not_null()
This method is implemented by I2CE_Module_FieldLimits->checkLimit_not_null()
checkLimitString_null()
This method is implemented by I2CE_Module_FieldLimits->checkLimitString_null()
checkLimitString_not_null()
This method is implemented by I2CE_Module_FieldLimits->checkLimitString_not_null()
checkLimitString_null_not_null()
This method is implemented by I2CE_Module_FieldLimits->checkLimitString_null_not_null()
getLimitMenu_null()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_null()
getLimitMenu_not_null()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_not_null()
getLimitMenu_null_not_null()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_null_not_null()
processLimitMenu_null()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_null()
processLimitMenu_not_null()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_not_null()
processLimitMenu_null_not_null()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_null_not_null()
generateLimit_max_parent()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_max_parent()
generateLimit_min_parent()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_min_parent()
generateLimit_max_parent_form()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_max_parent_form()
generateLimit_min_parent_form()
This method is implemented by I2CE_Module_FieldLimits->generateLimit_min_parent_form()
getLimitMenu_max_parent()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_max_parent()
getLimitMenu_min_parent()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_min_parent()
getLimitMenu_max_parent_form()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_max_parent_form()
getLimitMenu_min_parent_form()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_DISPLAYFIELDSTYLE_min_parent_form()
processLimitMenu_max_parent()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_max_parent()
processLimitMenu_min_parent()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_min_parent()
processLimitMenu_max_parent_form()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_max_parent_form()
processLimitMenu_min_parent_form()
This method is implemented by I2CE_Module_FieldLimits->I2CE_FormField_PROCESSFIELDSTYLE_min_parent_form()
save()
This method is implemented by I2CE_FormStorage->FF_save()
globalFieldUpdate()
This method is implemented by I2CE_FormStorage->globalFieldUpdate()
populateHistory()
This method is implemented by I2CE_FormStorage->FF_populateHistory()
Fuzzy CLI Methods
cachedTableReference()
This method is implemented by I2CE_Module_CachedForms->cachedTableReference()