Class: I2CE FormField (Development)

From IHRIS Wiki


This article describes the abstract class I2CE_FormField .

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.

$options

An associative array with all the options for this form field.

$value

The value of this field.

$headers

A list of headers for this form field.

$href

A URL to be used as a link for this field when displaying the value.

$container

A reference to the field conatiner object this field is a part of.

$history

A list of objects for all entries for this field.

$history_idx

The index for cycling through all historical entries.

$attributes

A list of attributes for this FormField instance.

$invalid

error messages to be displayed when a form is invalid. . string or array of "extra" setInvalid

Methods

__construct()

Create a new instance of a I2CE_FormField

addHistory()

Add a history entry to this field.

compare()

Compares this form field agains the given form field.

createField()

Instantiantiate a field given its short class name

  • Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FormField.php on line 94
  • Signature: static public function createField($formfield,$name,$args)
  • 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()
  • Returns: mixed
    I2CE_FormField or false on failure

displayInvalid()

Displays invalid/error messages on the given node @var I2CE_Template $template @var DOMNode $node

firstHistory()

Reset the history_idx history index and return the first element

getAttribute()

Return the attribute value for a given attribute.

getContainer()

Returns the form object for this field.

getDBType()

Return the DB field type for this type.

getDBValue()

Returns the value of this field ready to be stored in the database.

getDefaultValue()

Gets the default value from the field's data

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.

getDisplays()

Get the display styles registered for this form field. Will always include 'default'

getElement()

getFromDB()

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

getHTMLName()

Return the value for the name attribute to be used for this field in a form.

getHeader()

Return the given header by type

getHref()

Return the URL to be used as a link for this field for display.

getInvalid()

Return the invalid information.

getMDB2Type()

Return the MDB2 field type for this field. If it isn't set return the DB type.

getName()

Returns the field name of this field.

getOption()

Get the value stored at a named option exists

getOptionsByPath()

getString()

Return the type string for this field.

getTypeString()

Return the string name for a given type.

getValue()

Returns the value of this field.

hasAttribute()

Return true if a given attribute exists for this form.

hasDisplay()

Checks to see if the given display type is registed for this form field.

hasHeader()

Check to see if the given header type exists

hasInvalid()

Checks to see if there are any entries in the invalid array.

hasNextHistory()

Check to see if there are remaining DBEntry elements in history array.

hasOption()

Check if a named option exists

isInDB()

Checks to see if this field is saved in the database.

isSameValue()

Check to see if the given DB value is equivalent to this value.

isValid()

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

issetValue()

Checks to see if the value has been set.

nextHistory()

Return the next DBEntry element from the history array.

optionsHasPath()

processDOM()

Process this form field as a DOM element to place it in the template at the given node.

processDOMEditable()

processDOMNotEditable()

setAttribute()

Set an attribute for this form.

setContainer()

Sets the field container object for this field.

setDefaultOptions()

Sets the default options, headers etc. from the field data

setElement()

setFromDB()

Sets the value of this field from the database format.

setFromPost()

Sets the value of this field from the posted form.

setHeaders()

Set the headers for this form field.

setHref()

Set the URL for this field

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.

setValue()

Sets the value of this field.

unsetValue()

Unsets the value of this field.

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()

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_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()

populateHistory()

This method is implemented by I2CE_FormStorage->FF_populateHistory()

Fuzzy CLI Methods

cachedTableReference()

This method is implemented by I2CE_Module_CachedForms->cachedTableReference()