Class: I2CE FormStorage: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 2: Line 2:
*Extends the class: [[Class: I2CE_Module | I2CE_Module]].
*Extends the class: [[Class: I2CE_Module | I2CE_Module]].
*Location: Part of the module [[I2CE Module List#forms-storage|forms-storage]] in the package [https://launchpad.net/i2ce I2CE]
*Location: Part of the module [[I2CE Module List#forms-storage|forms-storage]] in the package [https://launchpad.net/i2ce I2CE]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L38 modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 38
*Author: Carl Leitner <litlfred@ibiblio.org>
*Author: Carl Leitner <litlfred@ibiblio.org>
*Since: 3.2
*Since: 3.2
Line 9: Line 9:
===$componentized_forms===
===$componentized_forms===
A cached list of componentized forms. array of string,  the form names
A cached list of componentized forms. array of string,  the form names
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L156 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 156
*Type: static protected static $componentized_forms
*Type: static protected static $componentized_forms


===$storage===
===$storage===
An array with a cache of the storage type for a form.
An array with a cache of the storage type for a form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L182 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 182
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $storage
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $storage


===$storageMechs===
===$storageMechs===
An array with a cache of the storage mechanisms
An array with a cache of the storage mechanisms
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L214 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 214
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $storageMechs
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $storageMechs


Line 22: Line 25:
===FF_IG_save()===
===FF_IG_save()===
Save the FormField to the database.
Save the FormField to the database.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1127 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1127
*Signature: public function FF_IG_save($form_field,$do_check,$user)
*Signature: public function FF_IG_save($form_field,$do_check,$user)
*Parameters:
*Parameters:
Line 28: Line 32:
**$user  
**$user  
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1127 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1127
===FF_IG_setSequence()===
===FF_IG_setSequence()===
Set the value of this field to the next sequence for the form field.
Set the value of this field to the next sequence for the form field.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1185 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1185
*Signature: public function FF_IG_setSequence($form_field)
*Signature: public function FF_IG_setSequence($form_field)
*Parameters:
*Parameters:
** [[Class: I2CE_FormField_INT_GENERATE | I2CE_FormField_INT_GENERATE]] $form_field
** [[Class: I2CE_FormField_INT_GENERATE | I2CE_FormField_INT_GENERATE]] $form_field
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1185 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1185
===FF_SP_save()===
===FF_SP_save()===
Save the FormField_STRING_PASS to the database.
Save the FormField_STRING_PASS to the database.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1156 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1156
*Signature: public function FF_SP_save($form_field,$do_check,$user)
*Signature: public function FF_SP_save($form_field,$do_check,$user)
*Parameters:
*Parameters:
Line 43: Line 47:
**$user  
**$user  
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1156 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1156
===FF_populateHistory()===
===FF_populateHistory()===
Populate the history of entries for the form field if the storage module handles history.
Populate the history of entries for the form field if the storage module handles history.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1205 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1205
*Signature: public function FF_populateHistory($form_field)
*Signature: public function FF_populateHistory($form_field)
*Parameters:
*Parameters:
** [[Class: I2CE_FormField | I2CE_FormField]] $form_field
** [[Class: I2CE_FormField | I2CE_FormField]] $form_field
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1205 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1205
===FF_save()===
===FF_save()===
Save the FormField to the database.
Save the FormField to the database.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1103 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1103
*Signature: public function FF_save($form_field,$do_check,$user)
*Signature: public function FF_save($form_field,$do_check,$user)
*Parameters:
*Parameters:
Line 59: Line 63:
**$user  
**$user  
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1103 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1103
===addChild()===
===addChild()===
add  the given child to the form for this object.
add  the given child to the form for this object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L925 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 925
*Signature: public function addChild($form,$form_name,$id)
*Signature: public function addChild($form,$form_name,$id)
*Parameters:
*Parameters:
Line 67: Line 71:
** [http://www.php.net/manual/en/language.types.string.php string ] $form_name <br/>The form name to add @param string  the id of this form
** [http://www.php.net/manual/en/language.types.string.php string ] $form_name <br/>The form name to add @param string  the id of this form
**$id  
**$id  
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L925 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 925
===delete()===
===delete()===
Delete a form object.
Delete a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1068 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1068
*Signature: public function delete($form,$transact,$complete,$no_history)
*Signature: public function delete($form,$transact,$complete,$no_history)
*Parameters:
*Parameters:
Line 80: Line 84:
***Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1068 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1068
===getChildIds()===
===getChildIds()===
Gets the id's for the given child for this form.
Gets the id's for the given child for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L906 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 906
*Signature: public function getChildIds($form,$child_form_name,$order_by,$where,$limit)
*Signature: public function getChildIds($form,$child_form_name,$order_by,$where,$limit)
*Parameters:
*Parameters:
Line 94: Line 98:
***Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L906 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 906
===getComponentizedForms()===
===getComponentizedForms()===
static function which gets a list of all componentized forms
static function which gets a list of all componentized forms
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L162 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 162
*Signature: static public function getComponentizedForms($use_cache)
*Signature: static public function getComponentizedForms($use_cache)
*Parameters:
*Parameters:
Line 102: Line 106:
***Default Value: true
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the componentized forms
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the componentized forms
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L162 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 162
===getHooks()===
===getHooks()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L76 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 76
*Signature: static public function getHooks()
*Signature: static public function getHooks()
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L76 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 76
===getMechanismByStorage()===
===getMechanismByStorage()===
Returns the storage mechanism for the given storage type.
Returns the storage mechanism for the given storage type.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L232 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 232
*Signature: static public function getMechanismByStorage($storage)
*Signature: static public function getMechanismByStorage($storage)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $storage
** [http://www.php.net/manual/en/language.types.string.php string ] $storage
*Returns: [[Class: I2CE_FormStorage_Mechanism | I2CE_FormStorage_Mechanism]]<br/>or false on failure
*Returns: [[Class: I2CE_FormStorage_Mechanism | I2CE_FormStorage_Mechanism]]<br/>or false on failure
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L232 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 232
===getMethods()===
===getMethods()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L42 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 42
*Signature: static public function getMethods()
*Signature: static public function getMethods()
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L42 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 42
===getMigratedValue()===
===getMigratedValue()===
Get the new value for a field that has been migrated.
Get the new value for a field that has been migrated.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L350 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 350
*Signature: static public function getMigratedValue($migrate_node,$form,$old_id,$field,$map_form)
*Signature: static public function getMigratedValue($migrate_node,$form,$old_id,$field,$map_form)
*Parameters:
*Parameters:
Line 126: Line 130:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $map_form
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $map_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 ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L350 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 350
===getNewMigratedValue()===
===getNewMigratedValue()===
Get the new migrated value for from the old value. @param mixed $old_id
Get the new migrated value for from the old value. @param mixed $old_id
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L327 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 327
*Signature: static public function getNewMigratedValue($migrate_node,$map_form,$old_value,$old_amt)
*Signature: static public function getNewMigratedValue($migrate_node,$map_form,$old_value,$old_amt)
*Parameters:
*Parameters:
Line 137: Line 141:
***Default Value: 0  
***Default Value: 0  
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L327 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 327
===getOldMigratedValue()===
===getOldMigratedValue()===
Get the old value for a field that has been migrated.
Get the old value for a field that has been migrated.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L276 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 276
*Signature: static public function getOldMigratedValue($migrate_node,$form,$old_id,$field,$map_form)
*Signature: static public function getOldMigratedValue($migrate_node,$form,$old_id,$field,$map_form)
*Parameters:
*Parameters:
Line 148: Line 152:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $map_form
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $map_form
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>array( 'map_form', 'old_value' );
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>array( 'map_form', 'old_value' );
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L276 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 276
===getRecords()===
===getRecords()===
Return an array of all the record ids for a given form.
Return an array of all the record ids for a given form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1230 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1230
*Signature: public function getRecords($factory,$form_name)
*Signature: public function getRecords($factory,$form_name)
*Parameters:
*Parameters:
Line 156: Line 160:
**$form_name  
**$form_name  
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1230 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1230
===getStorage()===
===getStorage()===
Return the storage class for the given form.
Return the storage class for the given form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L192 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 192
*Signature: static public function getStorage($form_name,$no_cache)
*Signature: static public function getStorage($form_name,$no_cache)
*Parameters:
*Parameters:
Line 165: Line 169:
***Default Value: false  
***Default Value: false  
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L192 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 192
===getStorageMechanism()===
===getStorageMechanism()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L222 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 222
*Signature: static public function getStorageMechanism($form_name,$no_cache)
*Signature: static public function getStorageMechanism($form_name,$no_cache)
*Parameters:
*Parameters:
Line 173: Line 177:
***Default Value: false  
***Default Value: false  
*Returns: [[Class: I2CE_FormStorage_Mechanism | I2CE_FormStorage_Mechanism]]<br/>or false on failure
*Returns: [[Class: I2CE_FormStorage_Mechanism | I2CE_FormStorage_Mechanism]]<br/>or false on failure
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L222 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 222
===isComponentized()===
===isComponentized()===
static function to determine if a form is componentized
static function to determine if a form is componentized
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L139 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 139
*Signature: static public function isComponentized($form)
*Signature: static public function isComponentized($form)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form
** [http://www.php.net/manual/en/language.types.string.php string ] $form
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L139 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 139
===isComponentizedForm()===
===isComponentizedForm()===
Fuzzy method to check if a form instance is componentized
Fuzzy method to check if a form instance is componentized
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L763 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 763
*Signature: public function isComponentizedForm($formClass)
*Signature: public function isComponentizedForm($formClass)
*Parameters:
*Parameters:
** [[Class: I2CE_Form | I2CE_Form]] $formClass
** [[Class: I2CE_Form | I2CE_Form]] $formClass
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L763 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 763
===isWritable()===
===isWritable()===
Check to see if this form is considered to be writable.
Check to see if this form is considered to be writable.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1253 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1253
*Signature: static public function isWritable($form)
*Signature: static public function isWritable($form)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $form <br/>string, I2CE_Form or I2CE_FormField
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $form <br/>string, I2CE_Form or I2CE_FormField
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1253 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1253
===listDisplayFields()===
===listDisplayFields()===
Lists the display values for a field
Lists the display values for a field
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L735 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 735
*Signature: static public function listDisplayFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time)
*Signature: static public function listDisplayFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time)
*Parameters:
*Parameters:
Line 211: Line 215:
***Default Value: -1
***Default Value: -1
*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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L735 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 735
===listFields()===
===listFields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L709 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 709
*Signature: static public function listFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time)
*Signature: static public function listFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time)
*Parameters:
*Parameters:
Line 228: Line 232:
***Default Value: -1
***Default Value: -1
*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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L709 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 709
===lookupDisplayField()===
===lookupDisplayField()===
Looks up the display value of the item based on the code. This is the default method that most implementations of lookup () use.  It finds the description of the object based on the code and saves it in the cache  and returns it.
Looks up the display value of the item based on the code. This is the default method that most implementations of lookup () use.  It finds the description of the object based on the code and saves it in the cache  and returns it.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L680 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 680
*Signature: static public function lookupDisplayField($form,$id,$fields,$delim)
*Signature: static public function lookupDisplayField($form,$id,$fields,$delim)
*Parameters:
*Parameters:
Line 240: Line 244:
***Default Value: '-'
***Default Value: '-'
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>or false on failure
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>or false on failure
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L680 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 680
===lookupField()===
===lookupField()===
Looks up the dbvalue of the item based on the code. This is the default method that most implementations of lookup () use.  It finds the description of the object based on the code and saves it in the cache  and returns it.
Looks up the dbvalue of the item based on the code. This is the default method that most implementations of lookup () use.  It finds the description of the object based on the code and saves it in the cache  and returns it.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L653 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 653
*Signature: static public function lookupField($form,$id,$fields,$delim)
*Signature: static public function lookupField($form,$id,$fields,$delim)
*Parameters:
*Parameters:
Line 252: Line 256:
***Default Value: '-'
***Default Value: '-'
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>or false on failure
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]<br/>or false on failure
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L653 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 653
===migrateField()===
===migrateField()===
Migrate field data from an old setMap reference to a new MAP form field type. The old data should have been saved in a migrate_data magic data (see storeMigrateData ).
Migrate field data from an old setMap reference to a new MAP form field type. The old data should have been saved in a migrate_data magic data (see storeMigrateData ).
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L543 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 543
*Signature: static public function migrateField($form_name,$field_list,$migrate_path,$user)
*Signature: static public function migrateField($form_name,$field_list,$migrate_path,$user)
*Parameters:
*Parameters:
Line 262: Line 266:
** [[Class: I2CE_User | I2CE_User]] $user <br/>The user to save the new form field.
** [[Class: I2CE_User | I2CE_User]] $user <br/>The user to save the new form field.
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L543 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 543
===migrateForm()===
===migrateForm()===
Migrate a given form from one storage method to the current storage method. This should only be used when upgrading a module that moved a form storage from one type to another.
Migrate a given form from one storage method to the current storage method. This should only be used when upgrading a module that moved a form storage from one type to another.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L388 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 388
*Signature: static public function migrateForm($form_name,$storage,$user,$migrate_path,$id_field,$skip_fields,$migrate_fields,$callback)
*Signature: static public function migrateForm($form_name,$storage,$user,$migrate_path,$id_field,$skip_fields,$migrate_fields,$callback)
*Parameters:
*Parameters:
Line 281: Line 285:
***Default Value: null  
***Default Value: null  
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L388 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 388
===populate()===
===populate()===
Populate a form object.
Populate a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L783 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 783
*Signature: public function populate($form)
*Signature: public function populate($form)
*Parameters:
*Parameters:
** [[Class: I2CE_Form | I2CE_Form]] $form
** [[Class: I2CE_Form | I2CE_Form]] $form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L783 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 783
===populateChild()===
===populateChild()===
Populate all instances of the given child form for this object.
Populate all instances of the given child form for this object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L948 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 948
*Signature: public function populateChild($form,$form_name,$order_by,$where,$type)
*Signature: public function populateChild($form,$form_name,$order_by,$where,$type)
*Parameters:
*Parameters:
Line 300: Line 304:
** [http://www.php.net/manual/en/language.types.string.php string ] $type <br/>Defaults to 'default'
** [http://www.php.net/manual/en/language.types.string.php string ] $type <br/>Defaults to 'default'
***Default Value: 'default'  
***Default Value: 'default'  
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L948 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 948
===populateChildren()===
===populateChildren()===
Populate the given child form for this object.
Populate the given child form for this object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L987 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 987
*Signature: public function populateChildren($form,$forms,$orderBy)
*Signature: public function populateChildren($form,$forms,$orderBy)
*Parameters:
*Parameters:
Line 309: Line 313:
** [http://www.php.net/manual/en/language.types.array.php array ] $orderBy <br/>An associative array of form names with an array of either string, field to sort by or an array of the fields Defaults to empty array - array( "contact" => "contact_type" )
** [http://www.php.net/manual/en/language.types.array.php array ] $orderBy <br/>An associative array of form names with an array of either string, field to sort by or an array of the fields Defaults to empty array - array( "contact" => "contact_type" )
***Default Value: array()
***Default Value: array()
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L987 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 987
===populateFirst()===
===populateFirst()===
Populate the first child of a form object based on the given field
Populate the first child of a form object based on the given field
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L865 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 865
*Signature: public function populateFirst($form,$forms)
*Signature: public function populateFirst($form,$forms)
*Parameters:
*Parameters:
Line 317: Line 321:
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>an associative array with keys form names and values field names or ordering array
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>an associative array with keys form names and values field names or ordering array
***Default Value: array()
***Default Value: array()
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L865 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 865
===populateHistory()===
===populateHistory()===
Populate Last of a form object.
Populate Last of a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L804 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 804
*Signature: public function populateHistory($form)
*Signature: public function populateHistory($form)
*Parameters:
*Parameters:
** [[Class: I2CE_Form | I2CE_Form]] $form
** [[Class: I2CE_Form | I2CE_Form]] $form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L804 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 804
===populateLast()===
===populateLast()===
Populate the last child of a form object based on the given field
Populate the last child of a form object based on the given field
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L818 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 818
*Signature: public function populateLast($form,$forms)
*Signature: public function populateLast($form,$forms)
*Parameters:
*Parameters:
Line 331: Line 335:
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>an associative array with keys form names and values field names or ordering array
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>an associative array with keys form names and values field names or ordering array
***Default Value: array()
***Default Value: array()
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L818 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 818
===save()===
===save()===
Save a form object.
Save a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1041 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1041
*Signature: public function save($form,$user,$transact)
*Signature: public function save($form,$user,$transact)
*Parameters:
*Parameters:
Line 340: Line 344:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $transact <br/>Defaults to true.
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $transact <br/>Defaults to true.
***Default Value: true
***Default Value: true
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1041 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1041
===search()===
===search()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L612 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 612
*Signature: static public function search($form,$parent,$where_data,$ordering,$limit)
*Signature: static public function search($form,$parent,$where_data,$ordering,$limit)
*Parameters:
*Parameters:
Line 354: Line 358:
***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.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L612 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 612
===setChangeType()===
===setChangeType()===
Set the change type for the given form. If this method isn't called then the change type will be I2CE_FormStorage::CHANGE_UPDATE
Set the change type for the given form. If this method isn't called then the change type will be I2CE_FormStorage::CHANGE_UPDATE
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1020 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1020
*Signature: public function setChangeType($form,$change_type,$field)
*Signature: public function setChangeType($form,$change_type,$field)
*Parameters:
*Parameters:
Line 364: Line 368:
** [http://www.php.net/manual/en/language.types.string.php string ] $field <br/>Defaults to 'default'.  optional field name to set the change type to.
** [http://www.php.net/manual/en/language.types.string.php string ] $field <br/>Defaults to 'default'.  optional field name to set the change type to.
***Default Value: 'default'
***Default Value: 'default'
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1020 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1020
===storeMigrateData()===
===storeMigrateData()===
Save the given fields to the given magic data node so it can later be referenced when migrating the form.
Save the given fields to the given magic data node so it can later be referenced when migrating the form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L255 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 255
*Signature: static public function storeMigrateData($forms,$migrate_path)
*Signature: static public function storeMigrateData($forms,$migrate_path)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>An array of forms with an array of fields for each: array( "form_name" => array( "field1", "field2" ) );
** [http://www.php.net/manual/en/language.types.array.php array ] $forms <br/>An array of forms with an array of fields for each: array( "form_name" => array( "field1", "field2" ) );
** [http://www.php.net/manual/en/language.types.string.php string ] $migrate_path <br/>The path in magic data to save the data
** [http://www.php.net/manual/en/language.types.string.php string ] $migrate_path <br/>The path in magic data to save the data
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L255 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 255
===validate_formfield()===
===validate_formfield()===
Hooked Function to check if a field is unique or unique restricted to a certain field
Hooked Function to check if a field is unique or unique restricted to a certain field
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L89 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 89
*Signature: public function validate_formfield($field_obj)
*Signature: public function validate_formfield($field_obj)
*Parameters:
*Parameters:
** [[Class: I2CE_FormField | I2CE_FormField]] $field_obj
** [[Class: I2CE_FormField | I2CE_FormField]] $field_obj
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L89 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 89
==Inherited Methods==
==Inherited Methods==
===__construct()===
===__construct()===

Revision as of 08:46, 10 November 2009

This article describes the class I2CE_FormStorage.

I2CE_Module_FormStorage

Variables

$componentized_forms

A cached list of componentized forms. array of string, the form names

$storage

An array with a cache of the storage type for a form.

$storageMechs

An array with a cache of the storage mechanisms

Methods

FF_IG_save()

Save the FormField to the database.

FF_IG_setSequence()

Set the value of this field to the next sequence for the form field.

FF_SP_save()

Save the FormField_STRING_PASS to the database.

FF_populateHistory()

Populate the history of entries for the form field if the storage module handles history.

FF_save()

Save the FormField to the database.

addChild()

add the given child to the form for this object.

delete()

Delete a form object.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 1068
  • Signature: public function delete($form,$transact,$complete,$no_history)
  • Parameters:
    • I2CE_Form $form
    • boolean $transact
      a flag to use transactions or not. default: true
      • Default Value: true
    • boolean $complete
      a flag to determine if a complete delete should happen. default: false
      • Default Value: false
    • boolean $no_history
      a flag to determine if the record should not go to the deleted_records table. default: false
      • Default Value: false
  • Returns: boolean

getChildIds()

Gets the id's for the given child for this form.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 906
  • Signature: public function getChildIds($form,$child_form_name,$order_by,$where,$limit)
  • Parameters:
    • I2CE_Form $form
    • string $child_form_name
      the child form name
    • mixed $order_by
      A string or array of strings. The fields to oreder by . defaults to empty array.
      • Default Value: array()
    • $where
      • 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: array

getComponentizedForms()

static function which gets a list of all componentized forms

getHooks()

getMechanismByStorage()

Returns the storage mechanism for the given storage type.

getMethods()

getMigratedValue()

Get the new value for a field that has been migrated.

getNewMigratedValue()

Get the new migrated value for from the old value. @param mixed $old_id

getOldMigratedValue()

Get the old value for a field that has been migrated.

getRecords()

Return an array of all the record ids for a given form.

getStorage()

Return the storage class for the given form.

getStorageMechanism()

isComponentized()

static function to determine if a form is componentized

isComponentizedForm()

Fuzzy method to check if a form instance is componentized

isWritable()

Check to see if this form is considered to be writable.

listDisplayFields()

Lists the display values for a field

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 735
  • Signature: static public function listDisplayFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time)
  • Parameters:
    • string $form
      The form name
    • array $fields
      of string. The fields we want returned
    • boolean $parent
      Defaults to false. If it is scalar and non-boolean, it is consider to be the ID of the parent, and then we get all forms with parent the given id.
      • Default Value: false
    • 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
    • integer $mod_time
      Defaults to -1. If non-negative, we only list the requested fields for an id if at least one of them has a modification time greater than or equal to $mod_time. If the form storage has no way of tracking modifucation time, all entries are listed.
      • Default Value: -1
  • 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.

listFields()

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 709
  • Signature: static public function listFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time)
  • Parameters:
    • string $form
      The form name
    • array $fields
      of string. The fields we want returned
    • boolean $parent
      Defaults to false. If it is scalar and non-boolean, it is consider to be the ID of the parent, and then we get all forms with parent the given id.
      • Default Value: false
    • 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
    • integer $mod_time
      Defaults to -1. If non-negative, we only list the requested fields for an id if at least one of them has a modification time greater than or equal to $mod_time. If the form storage has no way of tracking modifucation time, all entries are listed.
      • Default Value: -1
  • 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.

lookupDisplayField()

Looks up the display value of the item based on the code. This is the default method that most implementations of lookup () use. It finds the description of the object based on the code and saves it in the cache and returns it.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 680
  • Signature: static public function lookupDisplayField($form,$id,$fields,$delim)
  • Parameters:
    • string $form
      The name of the form in the database.
    • integer $id
      The code of the entry to lookup.
    • mixed $fields
      A field or an array of fields to look up and return. Defaults to 'name'
      • Default Value: array('name')
    • string $delim
      The delimiter to put between returned fields if there are more than one. If false , then we return as an array. Defaults to '-'
      • Default Value: '-'
  • Returns: string
    or false on failure

lookupField()

Looks up the dbvalue of the item based on the code. This is the default method that most implementations of lookup () use. It finds the description of the object based on the code and saves it in the cache and returns it.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 653
  • Signature: static public function lookupField($form,$id,$fields,$delim)
  • Parameters:
    • string $form
      The name of the form in the database.
    • integer $id
      The code of the entry to lookup.
    • mixed $fields
      A field or an array of fields to look up and return. Defaults to 'name'
      • Default Value: array('name')
    • string $delim
      The delimiter to put between returned fields if there are more than one. If false , then we return as an array. Defaults to '-'
      • Default Value: '-'
  • Returns: string
    or false on failure

migrateField()

Migrate field data from an old setMap reference to a new MAP form field type. The old data should have been saved in a migrate_data magic data (see storeMigrateData ).

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 543
  • Signature: static public function migrateField($form_name,$field_list,$migrate_path,$user)
  • Parameters:
    • string $form_name
    • array $field_list
      The list of fields that need to be changed as an array of field => map_form. Optionally the field list can be: array( "field" => array( "prev_field" => "prev_map_form" ) ) The field will get the old value from the list of fields (with mapped forms) for when the field name was changed.
    • string $migrate_path
      Where the migrate data has been saved.
    • I2CE_User $user
      The user to save the new form field.
  • Returns: boolean

migrateForm()

Migrate a given form from one storage method to the current storage method. This should only be used when upgrading a module that moved a form storage from one type to another.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 388
  • Signature: static public function migrateForm($form_name,$storage,$user,$migrate_path,$id_field,$skip_fields,$migrate_fields,$callback)
  • Parameters:
    • string $form_name
    • string $storage
      The old storage mechanism
    • I2CE_User $user
      The user object to use to save the new forms.
    • string $migrate_path
      The full path in MagicData to save the old to new mappings.
      • Default Value: false
    • string $id_field
      The old field name to use the value of for the new form id.
      • Default Value: false
    • array $skip_fields
      A list of fields to not migrate to the new form.
      • Default Value: array()
    • array $migrate_fields
      A list of fields that have already been migrated and need to use the migrate path to convert the data. Format is array( "field" => "map_form" ) These forms and fields should have already been passed to storeMigrateData so the data can be retrieved from there.
      • Default Value: array()
    • $callback
      • Default Value: null
  • Returns: boolean

populate()

Populate a form object.

populateChild()

Populate all instances of the given child form for this object.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 948
  • Signature: public function populateChild($form,$form_name,$order_by,$where,$type)
  • Parameters:
    • I2CE_Form $form
    • string $form_name
      The form name to populate
    • mixed $order_by
      A field or array of fields to sort by. Preceded by "-" to sort in reverse order. - array( "-start_date", "name" ). Defaults to null in which case if get the default sort order that is registered for the type (which defaults to none) @param mixed @where an aarray of where information to limit getting the child id's by. If null, we get the default limits for the type (which defaults to none)
      • Default Value: null
    • $where
      • Default Value: null
    • string $type
      Defaults to 'default'
      • Default Value: 'default'

populateChildren()

Populate the given child form for this object.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 987
  • Signature: public function populateChildren($form,$forms,$orderBy)
  • Parameters:
    • I2CE_Form $form
    • mixed $forms
      A string or an array such, the form names (the child forms to populate) - array( "demographic", "contact" )
    • array $orderBy
      An associative array of form names with an array of either string, field to sort by or an array of the fields Defaults to empty array - array( "contact" => "contact_type" )
      • Default Value: array()

populateFirst()

Populate the first child of a form object based on the given field

populateHistory()

Populate Last of a form object.

populateLast()

Populate the last child of a form object based on the given field

save()

Save a form object.

search()

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 612
  • Signature: static public function search($form,$parent,$where_data,$ordering,$limit)
  • Parameters:
    • string $form
      The form name.
    • boolean $parent
      Defaults to false. If it is scalar and non-boolean, it is consider to be the ID of the parent, and then we get all forms with parent the given id.
      • Default Value: false
    • mixed $where_data
      array or class implementing ArrayAccess, Iterator, and Countable (e.g. MagicDataNode) . the where data.
      • Default Value: array()
    • mixed $ordering
      An field or 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 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.

setChangeType()

Set the change type for the given form. If this method isn't called then the change type will be I2CE_FormStorage::CHANGE_UPDATE

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 1020
  • Signature: public function setChangeType($form,$change_type,$field)
  • Parameters:
    • I2CE_Form $form
    • integer $change_type
      the change type to set Defautls to I2CE_FormStorage::CHANGE_UPDATE
      • Default Value: I2CE_FormStorage_Mechanism::CHANGE_UPDATE
    • string $field
      Defaults to 'default'. optional field name to set the change type to.
      • Default Value: 'default'

storeMigrateData()

Save the given fields to the given magic data node so it can later be referenced when migrating the form.

validate_formfield()

Hooked Function to check if a field is unique or unique restricted to a certain field

Inherited Methods

__construct()

This public method is inherited from I2CE_Module->__construct()

action_configure()

This public method is inherited from I2CE_Module->action_configure()

action_disable()

This public method is inherited from I2CE_Module->action_disable()

action_enable()

This public method is inherited from I2CE_Module->action_enable()

action_initialize()

This public method is inherited from I2CE_Module->action_initialize()

conflict_external()

This public method is inherited from I2CE_Module->conflict_external()

getCLIHooks()

This public method is inherited from I2CE_Module->getCLIHooks()

getCLIMethods()

This public method is inherited from I2CE_Module->getCLIMethods()

getConfig()

This public method is inherited from I2CE_Module->getConfig()

post_update()

This public method is inherited from I2CE_Module->post_update()

pre_upgrade()

This public method is inherited from I2CE_Module->pre_upgrade()

requirement_external()

This public method is inherited from I2CE_Module->requirement_external()

upgrade()

This public method is inherited from I2CE_Module->upgrade()

_hasMethod()

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

Inherited Fuzzy Methods

launchBackgroundProcess()

This method is inherited from I2CE_Module->launchBackgroundProcess()

launchBackgroundPHPScript()

This method is inherited from I2CE_Module->launchBackgroundPHPScript()

launchBackgroundPage()

This method is inherited from I2CE_Module->launchBackgroundPage()

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()