Class: I2CE FieldContainer (4.1.12)
This article describes the abstract class I2CE_FieldContainer .
- Extends the class: I2CE_Fuzzy.
- Implements the interface Iterator
- Child Classes:
- I2CE_Form
- iHRIS_Contact
- I2CE_List
- I2CE_SimpleList
- iHRIS_UserMap
- I2CE_User_Form
- iHRIS_Position
- iHRIS_Cadre
- iHRIS_Scheduled_Training_Course
- iHRIS_Training_Course
- iHRIS_ContinuingEducationCourse
- iHRIS_Currency
- iHRIS_DataElement
- iHRIS_DataSet
- iHRIS_ListByCountry
- iHRIS_Country
- iHRIS_County
- iHRIS_District
- iHRIS_Region
- I2CE_Form_Locale
- iHRIS_Degree
- I2CE_ArchivedReport
- I2CE_Role
- iHRIS_EstablishmentPeriod
- iHRIS_Establishment
- iHRIS_Classification
- iHRIS_SalaryGrade
- iHRIS_Job
- iHRIS_Department
- iHRIS_ConfirmationType
- iHRIS_Certificate
- iHRIS_DisciplinaryActionReason
- iHRIS_TrainingDisruptionReason
- iHRIS_TrainingProgram
- iHRIS_ISCO_08_Major
- iHRIS_ISCO_08_Sub_Major
- iHRIS_ISCO_08_Minor
- iHRIS_ISCO_08_Unit
- iHRIS_ISCO_88_Major
- iHRIS_ISCO_88_Sub_Major
- iHRIS_ISCO_88_Minor
- iHRIS_ISCO_88_Unit
- iHRIS_Competency
- iHRIS_Training_Course_Evaluation
- iHRIS_Person
- iHRIS_UUID_Map
- iHRIS_Applicant
- iHRIS_PersonPosition
- iHRIS_Training
- iHRIS_Person_Scheduled_Training_Course
- iHRIS_Training_Course_Exam
- iHRIS_ContinuingEducation
- iHRIS_Document
- I2CE_ListLink
- iHRIS_UserAccessFacility
- iHRIS_Registration
- iHRIS_Demographic
- iHRIS_Education
- iHRIS_Employment
- iHRIS_PersonID
- iHRIS_PersonLanguage
- iHRIS_Notes
- iHRIS_Photo
- I2CE_GeneratedDoc
- iHRIS_Person_Record_Status
- iHRIS_RecordVerify
- iHRIS_UserCronReport
- iHRIS_Accident
- iHRIS_Salary
- iHRIS_Dependent
- iHRIS_DisciplinaryAction
- iHRIS_PositionInterview
- iHRIS_PositionDecision
- iHRIS_Benefit
- iHRIS_Confirmation
- iHRIS_Deployment
- iHRIS_SecondaryEducation
- iHRIS_Exam
- iHRIS_FacilityInstitution
- iHRIS_FacilityInstitutionEditFacility
- iHRIS_FacilityInstitutionEditInstitution
- iHRIS_InstitutionInspection
- iHRIS_License
- iHRIS_OutMigration
- iHRIS_PrivatePractice
- iHRIS_TrainingDisrupt
- iHRIS_PersonTraining
- iHRIS_PersonCompetency
- iHRIS_Training_Course_Competency_Evaluation
- I2CE_Form
- 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_FieldContainer.php on line 33
- Author: Carl Leitner <litlfred@ibiblio.org>
- Since: v4.0.6
@filesource Class I2CE_FieldContainer
Variables
$name
The name of this field container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 39
- Type: protected string $name
$display_name
The text name of this field container for display.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 44
- Type: protected string $display_name
$fields
The list of fields with all the information about each field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 49
- Type: protected array $fields
$attributes
A list of attributes for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 55
- Type: protected array $attributes
$static_attrs
A list of static attributes for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 60
- Type: static protected array $static_attrs
$id
The record id for this entry.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 66
- Type: protected mixed $id
$factory
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 389
- Type: protected I2CE_FieldContainer_Factory $factory
Methods
__construct()
Create a new instance of a I2CE_FieldContainer object.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 363
- Signature: public function __construct($factory,$name,$id)
- Parameters:
- I2CE_FieldContainer_Factory $factory
- string $name
The name of this field container - integer $id
- Default Value: '0'
__get()
Return the field value from the $fields array.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 495
- Signature: public function __get($key)
- Parameters:
- string $key
- Returns: mixed
__isset()
Check to see if a field value has been set.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 523
- Signature: public function __isset($key)
- Parameters:
- string $key
- Returns: boolean
__set()
Set the field value in the $fields array.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 508
- Signature: public function __set($key,$value)
- Parameters:
__unset()
Unset a field.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 535
- Signature: public function __unset($key)
- Parameters:
- string $key
addField()
Adds a field to this form.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 450
- Signature: public function addField($name,$args)
- Parameters:
- Returns: mixed
I2CE_FormField or false on failure
addFields()
Adds fields to the field container as indicated by the data arra
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 405
- Signature: protected function addFields($data)
- Parameters:
- array $data
An array with keys the name of a field and values an array of defining data.
- array $data
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.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 552
- Signature: public function cleanup($remove_from_cache)
- Parameters:
- boolean $remove_from_cache
Defaults to true in which case we remove it from the factory's field container cache as well- Default Value: true
- boolean $remove_from_cache
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.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 574
- Signature: public function clearFields($fields,$keep)
- Parameters:
current()
Return the current value for the $fields array for iterating through the fields.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 332
- Signature: public function current()
- Returns: mixed
getAttribute()
Return the attribute value for a given attribute.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 117
- Signature: public function getAttribute($key)
- Parameters:
- string $key
- Returns: mixed
getAttributes()
Returns the array of attributes for this container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 382
- Signature: protected function getAttributes()
- Returns: array
getContainerIndex()
Get the container's index. Either of the form "$containerName:$id" or "$containerName:0:$counter"
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 233
- Signature: public function getContainerIndex()
- Returns: string
or null on failure
getContainerType()
Return the value for the type of this container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 221
- Signature: public function getContainerType()
- Returns: string
or null on failure
getField()
Return the I2CE_FormField for the given field name.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 301
- Signature: public function getField($field)
- Parameters:
- string $field
the field name or a form name:field name
- string $field
- Returns: I2CE_FormField
getFieldNames()
Get the names of all the fields added in this field container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 291
- Signature: public function getFieldNames()
- Returns: array
of string, the field names.
getHTMLName()
Return the value for the name attribute to be used for this form to be used as part of a request variable
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 246
- Signature: public function getHTMLName()
- Returns: string
getHistory()
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 271
- Signature: public function getHistory($as_array)
- Parameters:
- $as_array
- Default Value: false
- $as_array
getId()
Returns the id for this record.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 80
- Signature: public function getId()
- Returns: string
getLoad()
Get the request variable in the format expected from {load()}
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 656
- Signature: public function getLoad()
getMeta()
Return the meta attribute value for a given meta.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 185
- Signature: public function getMeta($key)
- Parameters:
- string $key
- Returns: mixed
getName()
Return the name for this field container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 213
- Signature: public function getName()
- Returns: string
getNameId()
Returns the name and id for this record.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 72
- Signature: public function getNameId()
- Returns: string
of the form "$name|$id"
getPost()
Get the nested associative array that is used for post
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 640
- Signature: public function getPost($field_names,$skip_invalid,$include_id)
- Parameters:
- 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 853
- Signature: public function getQueryDisplay($field_names,$skip_invalid)
- Parameters:
- Returns: string
getQueryFields()
Return all the fields as an associative array
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 821
- 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
- array $field_names
- 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 791
- Signature: public function getQueryString($field_names,$skip_invalid)
- Parameters:
- Returns: string
getStaticAttribute()
Return the static attribute value for a given attribute.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 151
- Signature: public function getStaticAttribute($key)
- Parameters:
- string $key
- Returns: mixed
hasAttribute()
Return true if a given attribute exists for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 130
- Signature: public function hasAttribute($key)
- Parameters:
- string $key
- Returns: boolean;
hasField()
Check to see if the given field is in this container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 260
- Signature: public function hasField($field)
- Parameters:
- string $field
- Returns: boolean
hasInvalid()
Checks to see if any fields of form has in invalid message
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 921
- Signature: public function hasInvalid()
- Returns: boolean
hasMeta()
Return true if a given meta attribute exists for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 194
- Signature: public function hasMeta($key)
- Parameters:
- string $key
- Returns: boolean;
hasStaticAttribute()
Return true if a given static attribute exists for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 165
- Signature: public function hasStaticAttribute($key)
- Parameters:
- string $key
- Returns: boolean;
isValid()
Check to see if the named field is valid
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 936
- Signature: public function isValid($field)
- Parameters:
- string $field
- Returns: boolean;
isValidFieldName()
Checks to see if the given field name is valid
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 397
- Signature: protected function isValidFieldName($fieldName)
- Parameters:
- string $fieldName
- Returns: boolean
key()
Return the current key for the $fields array for iterating through the fields.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 339
- Signature: public function key()
- Returns: mixed
load()
Load the member variables from an array
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 680
- 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
- array $post
next()
Advance the internal pointer for the $fields array for iterating through the fields.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 345
- Signature: public function next()
preProcessFieldArgs()
Pre process the field args before setting them on the field object.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 440
- Signature: protected function preProcessFieldArgs($field,$args)
- Parameters:
removeField()
Removes a field from this field container. @param array $args The arguments for this field
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 478
- Signature: public function removeField($name)
- Parameters:
- string $name
rewind()
Rewind the internal pointer for the $fields array for iterating through the fields.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 325
- Signature: public function rewind()
setAttribute()
Set an attribute for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 108
- Signature: public function setAttribute($key,$value)
- Parameters:
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
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 597
- Signature: public function setFromPost($post,$populate_on_set_id)
- Parameters:
- array $post
- $populate_on_set_id
- Default Value: false
setId()
Set the id for this record.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 89
- Signature: public function setId($id)
- Parameters:
- mixed $id
setInvalidMessage()
Sets an invlalid message on the named field of a form
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 908
- Signature: public function setInvalidMessage($fieldName,$messageName,$extra)
- Parameters:
setMeta()
Set a meta attribute for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 176
- Signature: public function setMeta($key,$value)
- Parameters:
setName()
Set the name for this field container
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 204
- Signature: public function setName($name)
- Parameters:
- string $name
setStaticAttribute()
Set a static attribute for this field container.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 139
- Signature: public function setStaticAttribute($key,$value)
- Parameters:
valid()
Check to see if the current internal pointer for the $fields array is valid.
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 352
- Signature: public function valid()
- Returns: boolean
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
- Defined in i2ce/modules/Forms/modules/Fields/lib/I2CE_FieldContainer.php on line 888
- Signature: public function validate()
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()