Class: I2CE Form (Development): Difference between revisions

From IHRIS Wiki
(Created page with '{{otherversions|Class: I2CE_Form}} {{disambig}} {{DEFAULTSORT:Class: I2CE_Form (versions)}} Category:Broadcast call sign disambiguation pages This article describes the class…')
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{otherversions|Class: I2CE_Form}}
{{otherversions|Class: I2CE_Form}}
{{disambig}}
{{DEFAULTSORT:Class: I2CE_Form (versions)}}
[[Category:Broadcast call sign disambiguation pages]]
This article describes the class ''I2CE_Form'' .
This article describes the class ''I2CE_Form'' .
*Extends the class: [[Class: I2CE_Fuzzy (Development) | I2CE_Fuzzy]].
*Extends the class: [[Class: I2CE_FieldContainer (Development) | I2CE_FieldContainer]].
*Implements the interface [http://www.php.net/manual/en/class.iterator.php Iterator ]
*Child Classes:
*Child Classes:
** [[Class: I2CE_List (Development) | I2CE_List]]
** [[Class: I2CE_List (Development) | I2CE_List]]
*** [[Class: iHRIS_Contact (Development) | iHRIS_Contact]]
*** [[Class: iHRIS_Contact (Development) | iHRIS_Contact]]
*** [[Class: iHRIS_Currency (Development) | iHRIS_Currency]]
**** [[Class: iHRIS_NextOfKin (Development) | iHRIS_NextOfKin]]
*** [[Class: iHRIS_Country (Development) | iHRIS_Country]]
*** [[Class: iHRIS_Country (Development) | iHRIS_Country]]
*** [[Class: I2CE_SimpleList (Development) | I2CE_SimpleList]]
*** [[Class: I2CE_SimpleList (Development) | I2CE_SimpleList]]
*** [[Class: iHRIS_Job (Development) | iHRIS_Job]]
*** [[Class: iHRIS_Position (Development) | iHRIS_Position]]
*** [[Class: iHRIS_Position (Development) | iHRIS_Position]]
*** [[Class: iHRIS_Cadre (Development) | iHRIS_Cadre]]
*** [[Class: iHRIS_Cadre (Development) | iHRIS_Cadre]]
*** [[Class: iHRIS_TrainingProgram (Development) | iHRIS_TrainingProgram]]
*** [[Class: iHRIS_Competency (Development) | iHRIS_Competency]]
*** [[Class: iHRIS_Competency (Development) | iHRIS_Competency]]
*** [[Class: iHRIS_Scheduled_Training_Course (Development) | iHRIS_Scheduled_Training_Course]]
*** [[Class: iHRIS_Scheduled_Training_Course (Development) | iHRIS_Scheduled_Training_Course]]
*** [[Class: iHRIS_Training_Course (Development) | iHRIS_Training_Course]]
*** [[Class: iHRIS_Training_Course (Development) | iHRIS_Training_Course]]
*** [[Class: iHRIS_ContinuingEducationCourse (Development) | iHRIS_ContinuingEducationCourse]]
*** [[Class: iHRIS_ContinuingEducationCourse (Development) | iHRIS_ContinuingEducationCourse]]
*** [[Class: iHRIS_Currency (Development) | iHRIS_Currency]]
*** [[Class: iHRIS_ListByCountry (Development) | iHRIS_ListByCountry]]
*** [[Class: iHRIS_ListByCountry (Development) | iHRIS_ListByCountry]]
**** [[Class: iHRIS_Facility (Development) | iHRIS_Facility]]
**** [[Class: iHRIS_Facility (Development) | iHRIS_Facility]]
Line 29: Line 24:
*** [[Class: I2CE_Form_Locale (Development) | I2CE_Form_Locale]]
*** [[Class: I2CE_Form_Locale (Development) | I2CE_Form_Locale]]
*** [[Class: iHRIS_Degree (Development) | iHRIS_Degree]]
*** [[Class: iHRIS_Degree (Development) | iHRIS_Degree]]
*** [[Class: I2CE_ArchivedReport (Development) | I2CE_ArchivedReport]]
*** [[Class: I2CE_Role (Development) | I2CE_Role]]
*** [[Class: I2CE_Role (Development) | I2CE_Role]]
*** [[Class: iHRIS_EstablishmentPeriod (Development) | iHRIS_EstablishmentPeriod]]
*** [[Class: iHRIS_Establishment (Development) | iHRIS_Establishment]]
*** [[Class: iHRIS_Classification (Development) | iHRIS_Classification]]
*** [[Class: iHRIS_Classification (Development) | iHRIS_Classification]]
*** [[Class: iHRIS_SalaryGrade (Development) | iHRIS_SalaryGrade]]
*** [[Class: iHRIS_SalaryGrade (Development) | iHRIS_SalaryGrade]]
*** [[Class: iHRIS_Job (Development) | iHRIS_Job]]
**** [[Class: iHRIS_ManageJob (Development) | iHRIS_ManageJob]]
*** [[Class: iHRIS_Department (Development) | iHRIS_Department]]
*** [[Class: iHRIS_Department (Development) | iHRIS_Department]]
*** [[Class: iHRIS_Certificate (Development) | iHRIS_Certificate]]
*** [[Class: iHRIS_Certificate (Development) | iHRIS_Certificate]]
*** [[Class: iHRIS_DisciplinaryActionReason (Development) | iHRIS_DisciplinaryActionReason]]
*** [[Class: iHRIS_DisciplinaryActionReason (Development) | iHRIS_DisciplinaryActionReason]]
*** [[Class: iHRIS_TrainingDisruptionReason (Development) | iHRIS_TrainingDisruptionReason]]
*** [[Class: iHRIS_TrainingDisruptionReason (Development) | iHRIS_TrainingDisruptionReason]]
*** [[Class: iHRIS_TrainingProgram (Development) | iHRIS_TrainingProgram]]
*** [[Class: iHRIS_ISCO_08_Major (Development) | iHRIS_ISCO_08_Major]]
*** [[Class: iHRIS_ISCO_08_Major (Development) | iHRIS_ISCO_08_Major]]
*** [[Class: iHRIS_ISCO_08_Sub_Major (Development) | iHRIS_ISCO_08_Sub_Major]]
*** [[Class: iHRIS_ISCO_08_Sub_Major (Development) | iHRIS_ISCO_08_Sub_Major]]
Line 44: Line 45:
*** [[Class: iHRIS_Training_Course_Evaluation (Development) | iHRIS_Training_Course_Evaluation]]
*** [[Class: iHRIS_Training_Course_Evaluation (Development) | iHRIS_Training_Course_Evaluation]]
** [[Class: iHRIS_Person (Development) | iHRIS_Person]]
** [[Class: iHRIS_Person (Development) | iHRIS_Person]]
*** [[Class: iHRIS_ManagePerson (Development) | iHRIS_ManagePerson]]
*** [[Class: iHRIS_QualifyPerson (Development) | iHRIS_QualifyPerson]]
*** [[Class: iHRIS_QualifyPerson (Development) | iHRIS_QualifyPerson]]
*** [[Class: iHRIS_ManagePerson (Development) | iHRIS_ManagePerson]]
** [[Class: iHRIS_UUID_Map (Development) | iHRIS_UUID_Map]]
** [[Class: iHRIS_UUID_Map (Development) | iHRIS_UUID_Map]]
** [[Class: I2CE_User_Form (Development) | I2CE_User_Form]]
** [[Class: I2CE_User_Form (Development) | I2CE_User_Form]]
Line 60: Line 61:
** [[Class: iHRIS_ContinuingEducation (Development) | iHRIS_ContinuingEducation]]
** [[Class: iHRIS_ContinuingEducation (Development) | iHRIS_ContinuingEducation]]
** [[Class: iHRIS_Document (Development) | iHRIS_Document]]
** [[Class: iHRIS_Document (Development) | iHRIS_Document]]
** [[Class: I2CE_ListLink (Development) | I2CE_ListLink]]
*** [[Class: I2CE_ListLink_List (Development) | I2CE_ListLink_List]]
*** [[Class: I2CE_ListLink_String (Development) | I2CE_ListLink_String]]
** [[Class: iHRIS_Demographic (Development) | iHRIS_Demographic]]
** [[Class: iHRIS_Demographic (Development) | iHRIS_Demographic]]
*** [[Class: iHRIS_ManageDemographic (Development) | iHRIS_ManageDemographic]]
*** [[Class: iHRIS_ManageDemographic (Development) | iHRIS_ManageDemographic]]
Line 69: Line 73:
** [[Class: iHRIS_Notes (Development) | iHRIS_Notes]]
** [[Class: iHRIS_Notes (Development) | iHRIS_Notes]]
** [[Class: iHRIS_Photo (Development) | iHRIS_Photo]]
** [[Class: iHRIS_Photo (Development) | iHRIS_Photo]]
** [[Class: I2CE_GeneratedDoc (Development) | I2CE_GeneratedDoc]]
** [[Class: iHRIS_RecordVerify (Development) | iHRIS_RecordVerify]]
** [[Class: iHRIS_RecordVerify (Development) | iHRIS_RecordVerify]]
** [[Class: iHRIS_Accident (Development) | iHRIS_Accident]]
** [[Class: iHRIS_Accident (Development) | iHRIS_Accident]]
** [[Class: iHRIS_Dependent (Development) | iHRIS_Dependent]]
** [[Class: iHRIS_PositionInterview (Development) | iHRIS_PositionInterview]]
** [[Class: iHRIS_PositionInterview (Development) | iHRIS_PositionInterview]]
** [[Class: iHRIS_PositionDecision (Development) | iHRIS_PositionDecision]]
** [[Class: iHRIS_PositionDecision (Development) | iHRIS_PositionDecision]]
Line 91: Line 97:
Abstract class for objects using the [[Class: I2CE_Template (Development) | ]] 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.
Abstract class for objects using the [[Class: I2CE_Template (Development) | ]] 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==
==Variables==
===$form_name===
The name of this form for the database.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L41 i2ce/modules/Forms/lib/I2CE_Form.php] on line 41
*Type: private [http://www.php.net/manual/en/language.types.string.php string ] $form_name
===$display_name===
The text name of this form for display.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L46 i2ce/modules/Forms/lib/I2CE_Form.php] on line 46
*Type: private [http://www.php.net/manual/en/language.types.string.php string ] $display_name
===$fields===
The list of fields with all the information about each field.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L51 i2ce/modules/Forms/lib/I2CE_Form.php] on line 51
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $fields
===$parent===
===$parent===
String or boolean (false) The form and id  of the parent record for this form if there is one.  Of the form "$form|$id"
String or boolean (false) The form and id  of the parent record for this form if there is one.  Of the form "$form|$id"
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L56 i2ce/modules/Forms/lib/I2CE_Form.php] on line 56
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L41 i2ce/modules/Forms/lib/I2CE_Form.php] on line 41
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $parent
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $parent
===$id===
The record id for this entry.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L61 i2ce/modules/Forms/lib/I2CE_Form.php] on line 61
*Type: protected [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $id


===$children===
===$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.
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L70 i2ce/modules/Forms/lib/I2CE_Form.php] on line 70
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L50 i2ce/modules/Forms/lib/I2CE_Form.php] on line 50
*Type: public [http://www.php.net/manual/en/language.types.array.php array ] $children
*Type: public [http://www.php.net/manual/en/language.types.array.php array ] $children
===$attributes===
A list of attributes for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L75 i2ce/modules/Forms/lib/I2CE_Form.php] on line 75
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $attributes


===$parent_forms===
===$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
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L202 i2ce/modules/Forms/lib/I2CE_Form.php] on line 202
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L96 i2ce/modules/Forms/lib/I2CE_Form.php] on line 96
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $parent_forms
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $parent_forms


Line 134: Line 115:
===__construct()===
===__construct()===
Create a new instance of a I2CE_Form object.
Create a new instance of a I2CE_Form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L248 i2ce/modules/Forms/lib/I2CE_Form.php] on line 248
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L136 i2ce/modules/Forms/lib/I2CE_Form.php] on line 136
*Signature: public function __construct($form,$id)
*Signature: public function __construct($factory,$name,$id)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The name of this form
** [[Class: I2CE_FieldContainer_Factory (Development) | I2CE_FieldContainer_Factory]] $factory
** [http://www.php.net/manual/en/language.types.string.php string ] $name <br/>The name of this form
** integer $id
** integer $id
***Default Value: '0'  
***Default Value: '0'  
===__get()===
Return the [[Class: I2CE_FormField (Development) | form field]] value from the [[#$fields | $fields]] array.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L82 i2ce/modules/Forms/lib/I2CE_Form.php] on line 82
*Signature: protected function __get($key)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===__isset()===
Check to see if a [[Class: I2CE_FormField (Development) | form field]] value has been set.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L106 i2ce/modules/Forms/lib/I2CE_Form.php] on line 106
*Signature: protected function __isset($key)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===__set()===
Set the [[Class: I2CE_FormField (Development) | form field]] value in the [[#$fields | $fields]] array.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L95 i2ce/modules/Forms/lib/I2CE_Form.php] on line 95
*Signature: protected function __set($key,$value)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
===__unset()===
Unset a [[Class: I2CE_FormField (Development) | form field]].
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L118 i2ce/modules/Forms/lib/I2CE_Form.php] on line 118
*Signature: protected function __unset($key)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
===addChildForm()===
===addChildForm()===
Add a child form object to this forms list of children.
Add a child form object to this forms list of children.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L649 i2ce/modules/Forms/lib/I2CE_Form.php] on line 649
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L437 i2ce/modules/Forms/lib/I2CE_Form.php] on line 437
*Signature: public function addChildForm($child_form,$replace)
*Signature: public function addChildForm($child_form,$replace)
*Parameters:
*Parameters:
Line 175: Line 130:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $replace <br/>Overwrite the child object if it already exists.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $replace <br/>Overwrite the child object if it already exists.
***Default Value: false  
***Default Value: false  
===addField()===
Adds a field to this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L392 i2ce/modules/Forms/lib/I2CE_Form.php] on line 392
*Signature: public function addField($name,$args)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $name
** [http://www.php.net/manual/en/language.types.array.php array ] $args <br/>The arguments for this field
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>I2CE_FormField or false on failure
===addFormFields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L299 i2ce/modules/Forms/lib/I2CE_Form.php] on line 299
*Signature: protected function addFormFields($data)
*Parameters:
**$data
===cleanup()===
===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.
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L332 i2ce/modules/Forms/lib/I2CE_Form.php] on line 332
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L162 i2ce/modules/Forms/lib/I2CE_Form.php] on line 162
*Signature: public function cleanup()
*Signature: public function cleanup($remove_from_cache)
===clearFields()===
Remove fields from the form. This is to be used when only certain fields of the form are being dealt with so the others can be removed to save processing.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L700 i2ce/modules/Forms/lib/I2CE_Form.php] on line 700
*Signature: public function clearFields($fields,$keep)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.array.php array ] $fields <br/>The fields being worked with.
**$remove_from_cache
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $keep <br/>A flag to determine if the given fields should be removed or all except the given fields.
***Default Value: true
***Default Value: true  
===current()===
Return the current value for the [[#$fields | $fields]] array for iterating through the form fields.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L134 i2ce/modules/Forms/lib/I2CE_Form.php] on line 134
*Signature: public function current()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===displayField()===
===displayField()===
Display the field in the given node.
Display the field in the given node.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L549 i2ce/modules/Forms/lib/I2CE_Form.php] on line 549
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L308 i2ce/modules/Forms/lib/I2CE_Form.php] on line 308
*Signature: public function displayField($node,$template,$args)
*Signature: public function displayField($node,$template,$args)
*Parameters:
*Parameters:
Line 214: Line 146:
** [http://www.php.net/manual/en/language.types.array.php array ] $args
** [http://www.php.net/manual/en/language.types.array.php array ] $args
===form()===
===form()===
Return the form name for this form.
Return the form name for this form. @deprecated -- use {getName()}
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L522 i2ce/modules/Forms/lib/I2CE_Form.php] on line 522
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L281 i2ce/modules/Forms/lib/I2CE_Form.php] on line 281
*Signature: public function form()
*Signature: public function form()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getAllowedParentForms()===
===getAllowedParentForms()===
Gets the allowed parent forms for a given form
Gets the allowed parent forms for a given form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L213 i2ce/modules/Forms/lib/I2CE_Form.php] on line 213
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L107 i2ce/modules/Forms/lib/I2CE_Form.php] on line 107
*Signature: static public function getAllowedParentForms($form,$use_cache)
*Signature: static public function getAllowedParentForms($form,$use_cache)
*Parameters:
*Parameters:
Line 227: Line 159:
***Default Value: true
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the form names.
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the form names.
===getAttribute()===
Return the attribute value for a given attribute.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L907 i2ce/modules/Forms/lib/I2CE_Form.php] on line 907
*Signature: public function getAttribute($key)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===getChildForms()===
===getChildForms()===
Get the registered child forms for this form.
Get the registered child forms for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L162 i2ce/modules/Forms/lib/I2CE_Form.php] on line 162
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L56 i2ce/modules/Forms/lib/I2CE_Form.php] on line 56
*Signature: public function getChildForms()
*Signature: public function getChildForms()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>The list of child form names registered for this form.
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>The list of child form names registered for this form.
===getChildFormsByForm()===
===getChildFormsByForm()===
Get the registered child forms for the given form.
Get the registered child forms for the given form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L171 i2ce/modules/Forms/lib/I2CE_Form.php] on line 171
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L65 i2ce/modules/Forms/lib/I2CE_Form.php] on line 65
*Signature: static public function getChildFormsByForm($form)
*Signature: static public function getChildFormsByForm($form)
*Parameters:
*Parameters:
Line 248: Line 173:
===getChildren()===
===getChildren()===
Get the added children for this form
Get the added children for this form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L185 i2ce/modules/Forms/lib/I2CE_Form.php] on line 185
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L79 i2ce/modules/Forms/lib/I2CE_Form.php] on line 79
*Signature: public function getChildren($form)
*Signature: public function getChildren($form)
*Parameters:
*Parameters:
Line 256: Line 181:
===getDisplayName()===
===getDisplayName()===
Return the display name for this form object.
Return the display name for this form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L538 i2ce/modules/Forms/lib/I2CE_Form.php] on line 538
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L297 i2ce/modules/Forms/lib/I2CE_Form.php] on line 297
*Signature: public function getDisplayName()
*Signature: public function getDisplayName()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getField()===
===getField()===
Return the I2CE_FormField for the given field name.
Return the I2CE_FormField for the given field name.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L670 i2ce/modules/Forms/lib/I2CE_Form.php] on line 670
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L460 i2ce/modules/Forms/lib/I2CE_Form.php] on line 460
*Signature: public function getField($field)
*Signature: public function getField($field)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $field <br/>the field name or a form name:field name
** [http://www.php.net/manual/en/language.types.string.php string ] $field <br/>the field name or a form name:field name
*Returns: [[Class: I2CE_FormField (Development) | I2CE_FormField]]
*Returns: [[Class: I2CE_FormField (Development) | I2CE_FormField]]
===getFieldNames()===
Get the names of all the fields added in this form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L239 i2ce/modules/Forms/lib/I2CE_Form.php] on line 239
*Signature: public function getFieldNames()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the field names.
===getFormFieldsData()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L273 i2ce/modules/Forms/lib/I2CE_Form.php] on line 273
*Signature: protected function getFormFieldsData($class,$data)
*Parameters:
**$class
**&$data
===getFormId()===
Returns the form id for this record.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L353 i2ce/modules/Forms/lib/I2CE_Form.php] on line 353
*Signature: public function getFormId()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>of the form "$form|$id"
===getHTMLName()===
Return the value for the name attribute to be used for this field in a form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L812 i2ce/modules/Forms/lib/I2CE_Form.php] on line 812
*Signature: public function getHTMLName()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getId()===
Returns the id for this record.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L345 i2ce/modules/Forms/lib/I2CE_Form.php] on line 345
*Signature: public function getId()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getParent()===
===getParent()===
Return the parent id for this record. If there isn't a parent record set then return the id for this record.
Return the parent id for this record. If there isn't a parent record set then return the id for this record.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L419 i2ce/modules/Forms/lib/I2CE_Form.php] on line 419
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L176 i2ce/modules/Forms/lib/I2CE_Form.php] on line 176
*Signature: public function getParent()
*Signature: public function getParent()
*Returns: mixed.<br/>false if there is no parent id or string  a parent id of the form "$form|$id"
*Returns: mixed.<br/>false if there is no parent id or string  a parent id of the form "$form|$id"
===getParentForm()===
===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.
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L447 i2ce/modules/Forms/lib/I2CE_Form.php] on line 447
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L204 i2ce/modules/Forms/lib/I2CE_Form.php] on line 204
*Signature: public function getParentForm()
*Signature: public function getParentForm()
*Returns: mixed.<br/>false if there is no parent  the parent form
*Returns: mixed.<br/>false if there is no parent  the parent form
===getParentID()===
===getParentID()===
Return the parent id for this record. If there isn't a parent record set then return the id for this record.
Return the parent id for this record. If there isn't a parent record set then return the id for this record.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L429 i2ce/modules/Forms/lib/I2CE_Form.php] on line 429
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L186 i2ce/modules/Forms/lib/I2CE_Form.php] on line 186
*Signature: public function getParentID()
*Signature: public function getParentID()
*Returns: mixed.<br/>false if there is no parent id or string  a parent id
*Returns: mixed.<br/>false if there is no parent id or string  a parent id
===getQueryDisplay()===
===getPost()===
Return the values of all the fields that are set.
Get the nested associative array that is used for post
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L831 i2ce/modules/Forms/lib/I2CE_Form.php] on line 831
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L414 i2ce/modules/Forms/lib/I2CE_Form.php] on line 414
*Signature: public function getQueryDisplay()
*Signature: public function getPost($field_names,$skip_invalid,$include_id)
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Parameters:
===getQueryFields()===
** [http://www.php.net/manual/en/language.types.array.php array ] $field_names <br/>Array of string, the field names we wish to query.  Defaults to null in which we case we get all fields
Return all the fields as an associative array
***Default Value: null
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L819 i2ce/modules/Forms/lib/I2CE_Form.php] on line 819
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $skip_invalid <br/>Defaults to true in which case we skip invalid values
*Signature: public function getQueryFields()
***Default Value: true
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $include_id <br/>defaults to true
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
===getQueryString()===
Return all the fields as a query string to be sent to a URL
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L799 i2ce/modules/Forms/lib/I2CE_Form.php] on line 799
*Signature: public function getQueryString()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===hasAttribute()===
Return true if a given attribute exists for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L920 i2ce/modules/Forms/lib/I2CE_Form.php] on line 920
*Signature: public function hasAttribute($key)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
*Returns: boolean;
===hasInvalid()===
Checks to see if any fields of form has in invalid message
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L863 i2ce/modules/Forms/lib/I2CE_Form.php] on line 863
*Signature: public function hasInvalid()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===key()===
Return the current key for the [[#$fields | $fields]] array for iterating through the form fields.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L141 i2ce/modules/Forms/lib/I2CE_Form.php] on line 141
*Signature: public function key()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===listFields()===
===listFields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L978 i2ce/modules/Forms/lib/I2CE_Form.php] on line 978
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L553 i2ce/modules/Forms/lib/I2CE_Form.php] on line 553
*Signature: static public function listFields($form,$fields,$where_data,$ordering,$limit)
*Signature: static public function listFields($form,$fields,$where_data,$ordering,$limit)
*Parameters:
*Parameters:
Line 352: Line 231:
***Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>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.
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>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.
===load()===
Load the member variables from an array
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L769 i2ce/modules/Forms/lib/I2CE_Form.php] on line 769
*Signature: public function load($post,$loadID,$populate_on_set_id)
*Parameters:
** [http://www.php.net/manual/en/language.types.array.php array ] $post <br/>The Post vairables.  Usually from an http request.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $loadID <br/>Defaults to true.  If true, and there is exactly one of  entry in the array $post['forms'][$this->form_name], we set the values of the form's field, id and parent from that entry.  If false, we set the values from $post['forms'][$this->form_name][$this->getID()]  if it is present
***Default Value: true
**$populate_on_set_id
***Default Value: true
===lookupArray()===
===lookupArray()===
Lookup a given id in the given array.
Lookup a given id in the given array.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L880 i2ce/modules/Forms/lib/I2CE_Form.php] on line 880
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L487 i2ce/modules/Forms/lib/I2CE_Form.php] on line 487
*Signature: static protected function lookupArray($id,$arr)
*Signature: static protected function lookupArray($id,$arr)
*Parameters:
*Parameters:
Line 370: Line 239:
** [http://www.php.net/manual/en/language.types.array.php array ] $arr <br/>The array to search through.
** [http://www.php.net/manual/en/language.types.array.php array ] $arr <br/>The array to search through.
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===next()===
Advance the internal pointer for the [[#$fields | $fields]] array for iterating through the form fields.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L147 i2ce/modules/Forms/lib/I2CE_Form.php] on line 147
*Signature: public function next()
===processDOM()===
===processDOM()===
Process the DOM for this form.
Process the DOM for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L568 i2ce/modules/Forms/lib/I2CE_Form.php] on line 568
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L327 i2ce/modules/Forms/lib/I2CE_Form.php] on line 327
*Signature: public function processDOM($node,$template,$method,$args)
*Signature: public function processDOM($node,$template,$method,$args)
*Parameters:
*Parameters:
Line 383: Line 248:
** [http://www.php.net/manual/en/language.types.string.php string ] $method
** [http://www.php.net/manual/en/language.types.string.php string ] $method
** [http://www.php.net/manual/en/language.types.array.php array ] $args
** [http://www.php.net/manual/en/language.types.array.php array ] $args
===removeField()===
Removes a field from this form. @param array $args The arguments for this field
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L380 i2ce/modules/Forms/lib/I2CE_Form.php] on line 380
*Signature: public function removeField($name)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $name
===reset()===
===reset()===
Reset this object to its original state.
Reset this object to its original state.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L638 i2ce/modules/Forms/lib/I2CE_Form.php] on line 638
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L426 i2ce/modules/Forms/lib/I2CE_Form.php] on line 426
*Signature: public function reset()
*Signature: public function reset()
===rewind()===
Rewind the internal pointer for the [[#$fields | $fields]] array for iterating through the form fields.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L127 i2ce/modules/Forms/lib/I2CE_Form.php] on line 127
*Signature: public function rewind()
===search()===
===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.
@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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L939 i2ce/modules/Forms/lib/I2CE_Form.php] on line 939
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L514 i2ce/modules/Forms/lib/I2CE_Form.php] on line 514
*Signature: static public function search($form,$where_data,$ordering,$limit_one)
*Signature: static public function search($form,$where_data,$ordering,$limit_one)
*Parameters:
*Parameters:
Line 410: Line 265:
***Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>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.
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>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.
===setAttribute()===
Set an attribute for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L898 i2ce/modules/Forms/lib/I2CE_Form.php] on line 898
*Signature: public function setAttribute($key,$value)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $key
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
===setDisplayName()===
===setDisplayName()===
Set the display name for this form object.
Set the display name for this form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L530 i2ce/modules/Forms/lib/I2CE_Form.php] on line 530
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L289 i2ce/modules/Forms/lib/I2CE_Form.php] on line 289
*Signature: final public function setDisplayName($display)
*Signature: final public function setDisplayName($display)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $display
** [http://www.php.net/manual/en/language.types.string.php string ] $display
===setForm()===
===setForm()===
Set the form name for this form object.
Set the form name for this form object. @deprecated -- use {setName()}
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L514 i2ce/modules/Forms/lib/I2CE_Form.php] on line 514
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L272 i2ce/modules/Forms/lib/I2CE_Form.php] on line 272
*Signature: final public function setForm($name)
*Signature: final public function setForm($name)
*Parameters:
*Parameters:
Line 431: Line 279:
===setFromPost()===
===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
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 [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L721 i2ce/modules/Forms/lib/I2CE_Form.php] on line 721
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L399 i2ce/modules/Forms/lib/I2CE_Form.php] on line 399
*Signature: public function setFromPost($post,$populate_on_set_id)
*Signature: public function setFromPost($post,$populate_on_set_id)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.array.php array ] $post <br/>The post object is passed as a reference
** [http://www.php.net/manual/en/language.types.array.php array ] $post
**$populate_on_set_id  
**$populate_on_set_id  
***Default Value: false
***Default Value: false
===setId()===
Set the id for this record.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L362 i2ce/modules/Forms/lib/I2CE_Form.php] on line 362
*Signature: public function setId($id)
*Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $id
===setParent()===
===setParent()===
Set the parent id for this record
Set the parent id for this record
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L463 i2ce/modules/Forms/lib/I2CE_Form.php] on line 463
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L220 i2ce/modules/Forms/lib/I2CE_Form.php] on line 220
*Signature: public function setParent($parent,$set_id)
*Signature: public function setParent($parent,$set_id)
*Parameters:
*Parameters:
Line 451: Line 293:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $set_id <br/>If the parent will only have one child object then you can set the id by setting this to true.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $set_id <br/>If the parent will only have one child object then you can set the id by setting this to true.
***Default Value: false  
***Default Value: false  
==Inherited Methods==
===__get()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#__get() | I2CE_FieldContainer->__get()]]
===__isset()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#__isset() | I2CE_FieldContainer->__isset()]]
===__set()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#__set() | I2CE_FieldContainer->__set()]]
===__unset()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#__unset() | I2CE_FieldContainer->__unset()]]
===addField()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#addField() | I2CE_FieldContainer->addField()]]
===clearFields()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#clearFields() | I2CE_FieldContainer->clearFields()]]
===current()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#current() | I2CE_FieldContainer->current()]]
===getAttribute()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getAttribute() | I2CE_FieldContainer->getAttribute()]]
===getContainerType()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getContainerType() | I2CE_FieldContainer->getContainerType()]]
===getFieldNames()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getFieldNames() | I2CE_FieldContainer->getFieldNames()]]
===getHTMLName()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getHTMLName() | I2CE_FieldContainer->getHTMLName()]]
===getId()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getId() | I2CE_FieldContainer->getId()]]
===getLoad()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getLoad() | I2CE_FieldContainer->getLoad()]]
===getMeta()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getMeta() | I2CE_FieldContainer->getMeta()]]
===getName()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getName() | I2CE_FieldContainer->getName()]]
===getNameId()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getNameId() | I2CE_FieldContainer->getNameId()]]
===getQueryDisplay()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getQueryDisplay() | I2CE_FieldContainer->getQueryDisplay()]]
===getQueryFields()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getQueryFields() | I2CE_FieldContainer->getQueryFields()]]
===getQueryString()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#getQueryString() | I2CE_FieldContainer->getQueryString()]]
===hasAttribute()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#hasAttribute() | I2CE_FieldContainer->hasAttribute()]]
===hasInvalid()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#hasInvalid() | I2CE_FieldContainer->hasInvalid()]]
===hasMeta()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#hasMeta() | I2CE_FieldContainer->hasMeta()]]
===isValid()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#isValid() | I2CE_FieldContainer->isValid()]]
===key()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#key() | I2CE_FieldContainer->key()]]
===load()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#load() | I2CE_FieldContainer->load()]]
===next()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#next() | I2CE_FieldContainer->next()]]
===removeField()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#removeField() | I2CE_FieldContainer->removeField()]]
===rewind()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#rewind() | I2CE_FieldContainer->rewind()]]
===setAttribute()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#setAttribute() | I2CE_FieldContainer->setAttribute()]]
===setId()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#setId() | I2CE_FieldContainer->setId()]]
===setMeta()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#setMeta() | I2CE_FieldContainer->setMeta()]]
===setName()===
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#setName() | I2CE_FieldContainer->setName()]]
===valid()===
===valid()===
Check to see if the current internal pointer for the [[#$fields | $fields]] array is valid.
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#valid() | I2CE_FieldContainer->valid()]]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L154 i2ce/modules/Forms/lib/I2CE_Form.php] on line 154
 
*Signature: public function valid()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===validate()===
===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
This public method is inherited from [[Class: I2CE_FieldContainer (Development)#validate() | I2CE_FieldContainer->validate()]]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_Form.php#L852 i2ce/modules/Forms/lib/I2CE_Form.php] on line 852
 
*Signature: public function validate()
===addFields()===
==Inherited Methods==
This protected method is inherited from [[Class: I2CE_FieldContainer (Development)#addFields() | I2CE_FieldContainer->addFields()]]
 
===getAttributes()===
This protected method is inherited from [[Class: I2CE_FieldContainer (Development)#getAttributes() | I2CE_FieldContainer->getAttributes()]]
 
===_hasMethod()===
===_hasMethod()===
This public method is inherited from [[Class: I2CE_Fuzzy (Development)#_hasMethod() | I2CE_Fuzzy->_hasMethod()]]
This public method is inherited from [[Class: I2CE_Fuzzy (Development)#_hasMethod() | I2CE_Fuzzy->_hasMethod()]]
==Inherited Variables==
===$name===
Theis protected variable is inherited from [[Class: I2CE_FieldContainer (Development)#$name | I2CE_FieldContainer->$name]]
===$display_name===
Theis protected variable is inherited from [[Class: I2CE_FieldContainer (Development)#$display_name | I2CE_FieldContainer->$display_name]]
===$fields===
Theis protected variable is inherited from [[Class: I2CE_FieldContainer (Development)#$fields | I2CE_FieldContainer->$fields]]
===$attributes===
Theis protected variable is inherited from [[Class: I2CE_FieldContainer (Development)#$attributes | I2CE_FieldContainer->$attributes]]
===$id===
Theis protected variable is inherited from [[Class: I2CE_FieldContainer (Development)#$id | I2CE_FieldContainer->$id]]
===$factory===
Theis protected variable is inherited from [[Class: I2CE_FieldContainer (Development)#$factory | I2CE_FieldContainer->$factory]]
==Inherited Fuzzy Methods==
==Inherited Fuzzy Methods==
===userMessage()===
===userMessage()===
Line 483: Line 442:
===generateWhereClause()===
===generateWhereClause()===
This method is implemented by [[Class: I2CE_Module_FormLimits (Development)#generateWhereClause() | I2CE_Module_FormLimits->generateWhereClause() ]]
This method is implemented by [[Class: I2CE_Module_FormLimits (Development)#generateWhereClause() | I2CE_Module_FormLimits->generateWhereClause() ]]
===processLimit()===
This method is implemented by [[Class: I2CE_Module_FormLimits (Development)#processLimit() | I2CE_Module_FormLimits->processLimit() ]]
===getDisplayedExistingLimit()===
This method is implemented by [[Class: I2CE_Module_FormLimits (Development)#getDisplayedExistingLimit() | I2CE_Module_FormLimits->getDisplayedExistingLimit() ]]
===isComponentized()===
===isComponentized()===
This method is implemented by [[Class: I2CE_FormStorage (Development)#isComponentizedForm() | I2CE_FormStorage->isComponentizedForm() ]]
This method is implemented by [[Class: I2CE_FormStorage (Development)#isComponentizedForm() | I2CE_FormStorage->isComponentizedForm() ]]

Latest revision as of 07:55, 3 August 2010


This article describes the class I2CE_Form .

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

$parent

String or boolean (false) The form and id of the parent record for this form if there is one. Of the form "$form|$id"

$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.

$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

Methods

__construct()

Create a new instance of a I2CE_Form object.

addChildForm()

Add a child form object to this forms list of children.

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.

displayField()

Display the field in the given node.

form()

Return the form name for this form. @deprecated -- use {getName()}

getAllowedParentForms()

Gets the allowed parent forms for a given form

  • Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 107
  • Signature: static public function getAllowedParentForms($form,$use_cache)
  • Parameters:
    • string $form
    • boolean $use_cache
      Defaults to true in which case we cached result of finding parent forms
      • Default Value: true
  • Returns: array
    of string, the form names.

getChildForms()

Get the registered child forms for this form.

getChildFormsByForm()

Get the registered child forms for the given form.

  • Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 65
  • Signature: static public function getChildFormsByForm($form)
  • Parameters:
    • string $form
      The form to get the children of.
  • 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 79
  • 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
  • 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.

getField()

Return the I2CE_FormField for the given field name.

getParent()

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 176
  • 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.

getParentID()

Return the parent id for this record. If there isn't a parent record set then return the id for this record.

getPost()

Get the nested associative array that is used for post

  • Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 414
  • 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

listFields()

  • Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 553
  • 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
  • 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.

processDOM()

Process the DOM for this form.

reset()

Reset this object to its original state.

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 514
  • 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
  • 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.

setForm()

Set the form name for this form object. @deprecated -- use {setName()}

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

setParent()

Set the parent id for this record

  • Defined in i2ce/modules/Forms/lib/I2CE_Form.php on line 220
  • Signature: public function setParent($parent,$set_id)
  • Parameters:
    • mixed $parent
      string or I2CE_Form
    • boolean $set_id
      If the parent will only have one child object then you can set the id by setting this to true.
      • Default Value: false

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

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