Class: I2CE FieldContainer (4.1.7)

From IHRIS Wiki


This article describes the abstract class I2CE_FieldContainer .

@filesource Class I2CE_FieldContainer

Variables

$name

The name of this field container

$display_name

The text name of this field container for display.

$fields

The list of fields with all the information about each field.

$attributes

A list of attributes for this field container.

$id

The record id for this entry.

$factory

Methods

__construct()

Create a new instance of a I2CE_FieldContainer object.

__get()

Return the field value from the $fields array.

__isset()

Check to see if a field value has been set.

__set()

Set the field value in the $fields array.

__unset()

Unset a field.

addField()

Adds a field to this form.

addFields()

Adds fields to the field container as indicated by the data arra

cleanup()

Clean up all the fields for this field container. This will unset all the fields associated with this field container. This will remove all circular references to this field container so it can be cleaned up by the garbage collector. This should only be called when the field container is no longer needed. Trying to access it after this may cause unexpected results or errors.

clearFields()

Remove fields from the container This is to be used when only certain fields of the container are being dealt with so the others can be removed to save processing.

current()

Return the current value for the $fields array for iterating through the fields.

getAttribute()

Return the attribute value for a given attribute.

getAttributes()

Returns the array of attributes for this container

getContainerIndex()

Get the container's index. Either of the form "$containerName:$id" or "$containerName:0:$counter"

getContainerType()

Return the value for the type of this container

getField()

Return the I2CE_FormField for the given field name.

getFieldNames()

Get the names of all the fields added in this field container

getHTMLName()

Return the value for the name attribute to be used for this form to be used as part of a request variable

getHistory()

getId()

Returns the id for this record.

getLoad()

Get the request variable in the format expected from {load()}

getMeta()

Return the meta attribute value for a given meta.

getName()

Return the name for this field container

getNameId()

Returns the name and id for this record.

getPost()

Get the nested associative array that is used for post

  • Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 599
  • Signature: public function getPost($field_names,$skip_invalid,$include_id)
  • Parameters:
    • array $field_names
      Array of string, the field names we wish to query. Defaults to null in which we case we get all fields
      • Default Value: null
    • boolean $skip_invalid
      Defaults to true in which case we skip invalid values
      • Default Value: true
    • boolean $include_id
      defaults to true
      • Default Value: true
  • Returns: array

getQueryDisplay()

Return the values of all the fields that are set.

  • Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 812
  • Signature: public function getQueryDisplay($field_names,$skip_invalid)
  • Parameters:
    • array $field_names
      Array of string, the field names we wish to query. Defaults to null in which we case we get all fields
      • Default Value: null
    • boolean $skip_invalid
      Defaults to true in which case we skip invalid values
      • Default Value: true
  • Returns: string

getQueryFields()

Return all the fields as an associative array

  • Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 780
  • Signature: public function getQueryFields($field_names,$skip_invalid,$html_name)
  • Parameters:
    • array $field_names
      Array of string, the field names we wish to query. Defaults to null in which we case we get all fields
      • Default Value: null
    • boolean $skip_invalid
      Defaults to true in which case we skip invalid values
      • Default Value: true
    • boolean $html_name
      Use the html name as teh key in the returned array. Defaults to true. If false we use the field name
      • Default Value: true
  • Returns: array

getQueryString()

Return all the fields as a query string to be sent to a URL

  • Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 750
  • Signature: public function getQueryString($field_names,$skip_invalid)
  • Parameters:
    • array $field_names
      Array of string, the field names we wish to query. Defaults to null in which we case we get all fields
      • Default Value: null
    • boolean $skip_invalid
      Defaults to true in which case we skip invalid values
      • Default Value: true
  • Returns: string

hasAttribute()

Return true if a given attribute exists for this field container.

hasField()

Check to see if the given field is in this container

hasInvalid()

Checks to see if any fields of form has in invalid message

hasMeta()

Return true if a given meta attribute exists for this field container.

isValid()

Check to see if the named field is valid

isValidFieldName()

Checks to see if the given field name is valid

key()

Return the current key for the $fields array for iterating through the fields.

load()

Load the member variables from an array

  • Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 639
  • Signature: public function load($post,$loadID,$populate_on_set_id)
  • Parameters:
    • array $post
      The Post vairables. Usually from an http request.
    • boolean $loadID
      Defaults to true. If true, and there is exactly one of entry in the array $post[<<NAME>>][$this->name], we set the values of the containerss field, id and parent from that entry. If false, we set the values from $post[<<TYPE>>][$this->name][$this->getID()] if it is present
      • Default Value: true
    • $populate_on_set_id
      • Default Value: true

next()

Advance the internal pointer for the $fields array for iterating through the fields.

preProcessFieldArgs()

Pre process the field args before setting them on the field object.

removeField()

Removes a field from this field container. @param array $args The arguments for this field

rewind()

Rewind the internal pointer for the $fields array for iterating through the fields.

setAttribute()

Set an attribute for this field container.

setFromPost()

Load the member variables from an array The array can contain the keys 'id', 'parent', 'fields'. The later of which is an array indexed by field names and which contains the values of the field

setId()

Set the id for this record.

setInvalidMessage()

Sets an invlalid message on the named field of a form

setMeta()

Set a meta attribute for this field container.

setName()

Set the name for this field container

valid()

Check to see if the current internal pointer for the $fields array is valid.

validate()

Validate all fields that are marked as required or unique. This will check all the fields in this form and if they're required or unique it will perform the required checks

Inherited Methods

_hasMethod()

This public method is inherited from I2CE_Fuzzy->_hasMethod()

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()