Class: I2CE Form (4.0.14)
This article describes the class I2CE_Form .
- Extends the class: I2CE_FieldContainer.
- Child Classes:
- I2CE_List
- iHRIS_Contact
- iHRIS_Country
- I2CE_SimpleList
- I2CE_User_Form
- iHRIS_Position
- iHRIS_Cadre
- iHRIS_Scheduled_Training_Course
- iHRIS_Training_Course
- iHRIS_ContinuingEducationCourse
- iHRIS_Currency
- iHRIS_ListByCountry
- 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_UUID_Map
- iHRIS_Applicant
- iHRIS_PersonPosition
- iHRIS_Training
- iHRIS_ContinuingEducation
- iHRIS_Document
- I2CE_ListLink
- iHRIS_Registration
- iHRIS_Person
- iHRIS_Demographic
- iHRIS_Education
- iHRIS_Employment
- iHRIS_PersonID
- iHRIS_PersonLanguage
- iHRIS_Notes
- iHRIS_Photo
- I2CE_GeneratedDoc
- iHRIS_Person_Record_Status
- iHRIS_RecordVerify
- iHRIS_Accident
- iHRIS_Dependent
- iHRIS_DisciplinaryAction
- iHRIS_PositionInterview
- iHRIS_PositionDecision
- iHRIS_Benefit
- iHRIS_Confirmation
- iHRIS_Salary
- iHRIS_Deployment
- iHRIS_SecondaryEducation
- iHRIS_Exam
- iHRIS_FacilityInstitution
- iHRIS_FacilityInstitutionEditFacility
- iHRIS_FacilityInstitutionEditInstitution
- iHRIS_InstitutionInspection
- iHRIS_License
- iHRIS_OutMigration
- iHRIS_PrivatePractice
- iHRIS_TrainingDisrupt
- iHRIS_PersonCompetency
- iHRIS_Person_Scheduled_Training_Course
- iHRIS_Training_Course_Exam
- iHRIS_Training_Course_Competency_Evaluation
- I2CE_List
- Location: Part of the module forms in the package I2CE 4.0.14-release
- Source: Defined in the file modules/Forms/lib/I2CE_Form.php on line 36
- Author: Luke Duncan <lduncan@intrahealth.org>
- Since: v1.0.0
- See: I2CE_Template
Abstract class for objects using the class that interact with a database and HTML form. This class has a few default functions that are used when interacting with the template engine in setting up form values and displaying the data for objects that tie directly to database tables.
Variables
$children
An array of children objects for this form. It is an array of arrays. The first being an associative array with the name of the form, the second level is a simple array of the objects.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 46
- Type: public array $children
$parent_forms
parent_forms. The array with keys form names and values which are arrays of form names, the form names which the form's parent id can take values in
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 92
- Type: static protected array $parent_forms
$parentField
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 128
- Type: protected I2CE_FormField $parentField
Methods
__construct()
Create a new instance of a I2CE_Form object.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 147
- Signature: public function __construct($factory,$name,$id)
- Parameters:
- I2CE_FieldContainer_Factory $factory
- string $name
The name of this form - integer $id
- Default Value: '0'
addChildForm()
Add a child form object to this forms list of children.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 490
- Signature: public function addChildForm($child_form,$replace)
- Parameters:
cleanup()
Clean up all the fields for this form. This will unset all the fields associated with this form. This will remove all circular references to this form so it can be cleaned up by the garbage collector. This should only be called when the form is no longer needed. Trying to access it after this may cause unexpected results or errors.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 173
- Signature: public function cleanup($remove_from_cache)
- Parameters:
- $remove_from_cache
- Default Value: true
- $remove_from_cache
displayField()
Display the field in the given node.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 358
- Signature: public function displayField($node,$template,$args)
- Parameters:
- DOMNode $node
- I2CE_Template $template
- array $args
form()
Return the form name for this form. @deprecated -- use {getName()}
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 331
- Signature: public function form()
- Returns: string
getAllowedParentForms()
Gets the allowed parent forms for a given form
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 103
- Signature: static public function getAllowedParentForms($form,$use_cache)
- Parameters:
- Returns: array
of string, the form names.
getChildForms()
Get the registered child forms for this form.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 52
- Signature: public function getChildForms()
- Returns: array
The list of child form names registered for this form.
getChildFormsByForm()
Get the registered child forms for the given form.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 61
- Signature: static public function getChildFormsByForm($form)
- Parameters:
- string $form
The form to get the children of.
- string $form
- Returns: array
The list of child form names registered for the form.
getChildren()
Get the added children for this form
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 75
- Signature: public function getChildren($form)
- Parameters:
- string $form
Defaults to null, in which case we get all children. otherwise we get the popoluated children with the specified form- Default Value: null
- string $form
- Returns: array
If $form is null, it is an array with keys the form names and values array of the children of that form type. If $form is set, then it is an array of the forms of type $form
getDisplayName()
Return the display name for this form object.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 347
- Signature: public function getDisplayName()
- Returns: string
getField()
Return the I2CE_FormField for the given field name.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 513
- Signature: public function getField($field)
- Parameters:
- string $field
the field name or a form name:field name
- string $field
- Returns: I2CE_FormField
getFormID()
Return the form ID for this form.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 184
- Signature: public function getFormID()
- Returns: string @deprecated
getHistory()
Get the history of each field in this container. May need to populate the history
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 206
- Signature: public function getHistory($as_array)
- Parameters:
- boolean $as_array
Defaults to false in which case results are instances of I2CE_Entry, otherwise reusults are associative arrays- Default Value: false
- boolean $as_array
- Returns: array
index by field names
getParent()
Return the (db value of the) parent id for this record. If there isn't a parent record set then return the id for this record.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 195
- Signature: public function getParent()
- Returns: mixed.
false if there is no parent id or string a parent id of the form "$form|$id"
getParentForm()
Return the name of the parent form for this record. If there isn't a parent record set then return the id for this record.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 253
- Signature: public function getParentForm()
- Returns: mixed.
false if there is no parent the parent form
getParentID()
Return the parent id for this record. If there isn't a parent record set then return the id for this record.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 234
- Signature: public function getParentID()
- Returns: mixed.
false if there is no parent id or string a parent id
getPost()
Get the nested associative array that is used for post
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 467
- Signature: public function getPost($field_names,$skip_invalid,$include_id)
- Parameters:
- Returns: array
listFields()
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 602
- Signature: static public function listFields($form,$fields,$where_data,$ordering,$limit)
- Parameters:
- string $form
The form name - array $fields
of string. The fields we want returned - mixed $where_data
Either I2CE_MagicDataNode or array. contains the where clause information about this form or a nested- Default Value: array()
- array $ordering
An array of fields to order by. Defaults to the empty array. Prepend a - to order by in descending order.- Default Value: array()
- mixed $limit
Defaults to false. It true, returns only one result. If an integer it is the numeber of records to limit to. If it is as an array of two integers, it is the offset and then number of results to limit to.- Default Value: false
- string $form
- Returns: mixed
an array with key id's and value and array of values. the array of values has as keys the fields with their corresponding value.
lookupArray()
Lookup a given id in the given array.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 536
- Signature: static protected function lookupArray($id,$arr)
- Parameters:
- integer $id
The id to lookup. - array $arr
The array to search through.
- integer $id
- Returns: string
parentIsSet()
Checks to see if the parent field has been set
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 219
- Signature: public function parentIsSet()
processDOM()
Process the DOM for this form.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 377
- Signature: public function processDOM($node,$template,$method,$args)
- Parameters:
- DOMNode $node
- I2CE_Template $template
- string $method
- array $args
reset()
Reset this object to its original state.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 479
- Signature: public function reset()
search()
@param mixed $limit. Defaults to false. It true, returns only one result. If an integer it is the numeber of records to limit to. If it is as an array of two integers, it is the offset and then number of results to limit to.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 563
- Signature: static public function search($form,$where_data,$ordering,$limit_one)
- Parameters:
- string $form
The form name. - mixed $where_data
Either I2CE_MagicDataNode or array. contains the where clause information about this form or a nested- Default Value: array()
- array $ordering
An array of fields to order by. Defaults to the empty array. Prepend a - to order by in descending order.- Default Value: array()
- $limit_one
- Default Value: false
- string $form
- Returns: mixed
an array of matching form ids. However, ff $limit_one is true or 1 or array ($offset,1) then then we return either the id or false, if none found or there was an error.
setDisplayName()
Set the display name for this form object.
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 339
- Signature: final public function setDisplayName($display)
- Parameters:
- string $display
setForm()
Set the form name for this form object. @deprecated -- use {setName()}
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 322
- Signature: final public function setForm($name)
- Parameters:
- string $name
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/lib/I2CE_Form.php on line 452
- Signature: public function setFromPost($post,$populate_on_set_id)
- Parameters:
- array $post
- $populate_on_set_id
- Default Value: false
setParent()
Set the parent id for this record
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 270
- Signature: public function setParent($parent,$set_id)
- Parameters:
setupParentField()
Setup the parent field. the use of string_line is considered temporary. @param mixed $value. The value to set it to. Defaults to null in which case no value is set
- Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 134
- Signature: protected function setupParentField()
Inherited Methods
__get()
This public method is inherited from I2CE_FieldContainer->__get()
__isset()
This public method is inherited from I2CE_FieldContainer->__isset()
__set()
This public method is inherited from I2CE_FieldContainer->__set()
__unset()
This public method is inherited from I2CE_FieldContainer->__unset()
addField()
This public method is inherited from I2CE_FieldContainer->addField()
clearFields()
This public method is inherited from I2CE_FieldContainer->clearFields()
current()
This public method is inherited from I2CE_FieldContainer->current()
getAttribute()
This public method is inherited from I2CE_FieldContainer->getAttribute()
getContainerType()
This public method is inherited from I2CE_FieldContainer->getContainerType()
getFieldNames()
This public method is inherited from I2CE_FieldContainer->getFieldNames()
getHTMLName()
This public method is inherited from I2CE_FieldContainer->getHTMLName()
getId()
This public method is inherited from I2CE_FieldContainer->getId()
getLoad()
This public method is inherited from I2CE_FieldContainer->getLoad()
getMeta()
This public method is inherited from I2CE_FieldContainer->getMeta()
getName()
This public method is inherited from I2CE_FieldContainer->getName()
getNameId()
This public method is inherited from I2CE_FieldContainer->getNameId()
getQueryDisplay()
This public method is inherited from I2CE_FieldContainer->getQueryDisplay()
getQueryFields()
This public method is inherited from I2CE_FieldContainer->getQueryFields()
getQueryString()
This public method is inherited from I2CE_FieldContainer->getQueryString()
hasAttribute()
This public method is inherited from I2CE_FieldContainer->hasAttribute()
hasInvalid()
This public method is inherited from I2CE_FieldContainer->hasInvalid()
hasMeta()
This public method is inherited from I2CE_FieldContainer->hasMeta()
isValid()
This public method is inherited from I2CE_FieldContainer->isValid()
key()
This public method is inherited from I2CE_FieldContainer->key()
load()
This public method is inherited from I2CE_FieldContainer->load()
next()
This public method is inherited from I2CE_FieldContainer->next()
removeField()
This public method is inherited from I2CE_FieldContainer->removeField()
rewind()
This public method is inherited from I2CE_FieldContainer->rewind()
setAttribute()
This public method is inherited from I2CE_FieldContainer->setAttribute()
setId()
This public method is inherited from I2CE_FieldContainer->setId()
setMeta()
This public method is inherited from I2CE_FieldContainer->setMeta()
setName()
This public method is inherited from I2CE_FieldContainer->setName()
valid()
This public method is inherited from I2CE_FieldContainer->valid()
validate()
This public method is inherited from I2CE_FieldContainer->validate()
addFields()
This protected method is inherited from I2CE_FieldContainer->addFields()
getAttributes()
This protected method is inherited from I2CE_FieldContainer->getAttributes()
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Variables
$name
Theis protected variable is inherited from I2CE_FieldContainer->$name
$display_name
Theis protected variable is inherited from I2CE_FieldContainer->$display_name
$fields
Theis protected variable is inherited from I2CE_FieldContainer->$fields
$attributes
Theis protected variable is inherited from I2CE_FieldContainer->$attributes
$id
Theis protected variable is inherited from I2CE_FieldContainer->$id
$factory
Theis protected variable is inherited from I2CE_FieldContainer->$factory
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()
Fuzzy Methods
isNumeric()
This method is implemented by I2CE_Module_CustomReports->isNumeric()
getLimitStyles()
This method is implemented by I2CE_Module_FormLimits->getLimitStyles()
checkLimit()
This method is implemented by I2CE_Module_FormLimits->checkLimit()
checkWhereClause()
This method is implemented by I2CE_Module_FormLimits->checkWhereClause()
createCheckFunction()
This method is implemented by I2CE_Module_FormLimits->createCheckFunction()
createCheckLimitString()
This method is implemented by I2CE_Module_FormLimits->createCheckLimitString()
generateLimit()
This method is implemented by I2CE_Module_FormLimits->generateLimit()
generateWhereClause()
This method is implemented by I2CE_Module_FormLimits->generateWhereClause()
isComponentized()
This method is implemented by I2CE_FormStorage->isComponentizedForm()
addChild()
This method is implemented by I2CE_FormStorage->addChild()
getChildIds()
This method is implemented by I2CE_FormStorage->getChildIds()
getStorage()
This method is implemented by I2CE_FormStorage->getStorage()
isWritable()
This method is implemented by I2CE_FormStorage->isWritable()
populate()
This method is implemented by I2CE_FormStorage->populate()
storeHistory()
This method is implemented by I2CE_FormStorage->storeHistory()
populateChild()
This method is implemented by I2CE_FormStorage->populateChild()
populateChildren()
This method is implemented by I2CE_FormStorage->populateChildren()
populateFirst()
This method is implemented by I2CE_FormStorage->populateFirst()
populateHistory()
This method is implemented by I2CE_FormStorage->populateHistory()
populateLast()
This method is implemented by I2CE_FormStorage->populateLast()
delete()
This method is implemented by I2CE_FormStorage->delete()
save()
This method is implemented by I2CE_FormStorage->save()
setChangeType()
This method is implemented by I2CE_FormStorage->setChangeType()
changeID()
This method is implemented by I2CE_FormStorage->changeID()