Class: I2CE FormStorage (Development): Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
 
Line 2: Line 2:
This article describes the class ''I2CE_FormStorage'' .
This article describes the class ''I2CE_FormStorage'' .
*Extends the class: [[Class: I2CE_Module (Development) | I2CE_Module]].
*Extends the class: [[Class: I2CE_Module (Development) | I2CE_Module]].
*Location: Part of the module [[I2CE Module List (Development)#forms-storage|forms-storage]] in the package [https://launchpad.net/i2ce I2CE] 4.0-dev
*Location: Part of the module [[I2CE Module List (Development)#forms-storage|forms-storage]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L38 modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 38
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/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 10: Line 10:
===$lastListCount===
===$lastListCount===
A list of forms with the last count returned for listDisplayFields
A list of forms with the last count returned for listDisplayFields
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L43 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 43
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L122 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 122
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $lastListCount
*Type: static protected [http://www.php.net/manual/en/language.types.array.php array ] $lastListCount


===$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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L265 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 265
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L604 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 604
*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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L291 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 291
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L630 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 630
*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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L323 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 323
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L692 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 692
*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
===$populated_list===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1304 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1304
*Type: protected $populated_list
===$store_stmt===
Insert statment for storing form history
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1755 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1755
*Type: protected MDB2_PreparedStatemnt $store_stmt


==Methods==
==Methods==
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1284 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1284
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1854 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1854
*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 40: Line 49:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1342 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1342
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1912 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1912
*Signature: public function FF_IG_setSequence($form_field)
*Signature: public function FF_IG_setSequence($form_field)
*Parameters:
*Parameters:
Line 46: Line 55:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1313 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1313
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1883 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1883
*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 55: Line 64:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1362 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1362
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1932 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1932
*Signature: public function FF_populateHistory($form_field)
*Signature: public function FF_populateHistory($form_field)
*Parameters:
*Parameters:
Line 62: Line 71:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1260 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1260
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1830 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1830
*Signature: public function FF_save($form_field,$do_check,$user)
*Signature: public function FF_save($form_field,$do_check,$user)
*Parameters:
*Parameters:
Line 71: Line 80:
===_populate()===
===_populate()===
Internal worker method to populate a form object.
Internal worker method to populate a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L916 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 916
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1341 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1341
*Signature: public function _populate($form,$storageMechanism)
*Signature: public function _populate($form,$storageMechanism,$repopulate)
*Parameters:
*Parameters:
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [[Class: I2CE_FormStorage_Mechanism (Development) | I2CE_FormStorage_Mechanism]] $storageMechanism <br/>Default to null which indicates we should use the registered form storage mecahnsim.
** [[Class: I2CE_FormStorage_Mechanism (Development) | I2CE_FormStorage_Mechanism]] $storageMechanism <br/>Default to null which indicates we should use the registered form storage mecahnsim.
***Default Value: null
***Default Value: null
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $repopulate <br/>Defaults to 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 ]
===_save()===
===_save()===
Internal worker method to save a form object.
Internal worker method to save a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1195 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1195
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1699 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1699
*Signature: protected function _save($form,$user,$transact,$storageMechanism)
*Signature: protected function _save($form,$user,$transact,$storageMechanism)
*Parameters:
*Parameters:
Line 90: Line 101:
***Default Value: null
***Default Value: null
*Returns: boolean.<br/>true on success
*Returns: boolean.<br/>true on success
===action_initialize()===
Method called when the module is enabled for the first time. @param boolean -- returns true on success. false on error.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L46 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 46
*Signature: public function action_initialize()
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1061 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1061
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1492 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1492
*Signature: public function addChild($form,$form_name,$id)
*Signature: public function addChild($form,$form_name,$id)
*Parameters:
*Parameters:
Line 98: Line 113:
** [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  
===changeFormID()===
Change the id of the given form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1640 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1640
*Signature: static public function changeFormID($formid,$newid)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $formid <br/>i.e. "$form|$id"
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $newid
*Returns: boolean.<br/>true on success
===changeID()===
Change the id of the given form @param I2CE_Form $formObj
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1624 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1624
*Signature: public function changeID($form,$newid)
*Parameters:
**$form
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $newid
*Returns: boolean.<br/>true on success
===delete()===
===delete()===
Delete a form object.
Delete a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1225 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1225
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1730 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1730
*Signature: public function delete($form,$transact,$complete,$no_history)
*Signature: public function delete($form,$transact,$no_history)
*Parameters:
*Parameters:
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $transact <br/>a flag to use transactions or not. default: true
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $transact <br/>a flag to use transactions or not. default: true
***Default Value: true
***Default Value: true
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $complete <br/>a flag to determine if a complete delete should happen.  default: false
***Default Value: false
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $no_history <br/>a flag to determine if the record should not go to the deleted_records table. default: false
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $no_history <br/>a flag to determine if the record should not go to the deleted_records table. default: false
***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 ]
===duplicate()===
Use method to duplicate a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L535 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 535
*Signature: public function duplicate($form,$recurse,$save,$parentid,$user)
*Parameters:
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $recurse <br/>Defaults to false.  If true we duplicate all children, and {@param $save is forced to be true}
***Default Value: false
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $save <br/>Defaults to true.  If true we save the form at the same time we duplicate it.
***Default Value: true
** [http://www.php.net/manual/en/language.types.string.php string ] $parentid <br/>Defaults to null in which case the parent id of the duplicated form is not set
***Default Value: null
** [[Class: I2CE_User (Development) | I2CE_User]] $user <br/>the user object to save.  Defaults to null.
***Default Value: null
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>false on error or I2CE_Form, the duplicated form
===exportData()===
===exportData()===
Move data for a form from one storage mechansim to another
Move data for a form from one storage mechansim to another
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L218 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 218
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L505 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 505
*Signature: static public function exportData($form,$target,$user,$ids)
*Signature: static public function exportData($form,$target,$user,$ids)
*Parameters:
*Parameters:
Line 122: Line 166:
***Default Value: null
***Default Value: null
*Returns: boolean.<br/>true on success
*Returns: boolean.<br/>true on success
===form_cleanup()===
Hooked form cleanup method
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1309 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1309
*Signature: public function form_cleanup($args)
*Parameters:
**$args
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1042 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1042
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1473 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1473
*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 138: Line 188:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L271 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 271
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L610 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 610
*Signature: static public function getComponentizedForms($use_cache)
*Signature: static public function getComponentizedForms($use_cache)
*Parameters:
*Parameters:
Line 145: Line 195:
*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
===getHooks()===
===getHooks()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L81 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 81
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L165 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 165
*Signature: static public function getHooks()
*Signature: static public function getHooks()
===getLastListCount()===
===getLastListCount()===
Return the last results from a search query for a form.
Return the last results from a search query for a form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1453 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1453
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L2056 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 2056
*Signature: static public function getLastListCount($form)
*Signature: static public function getLastListCount($form)
*Parameters:
*Parameters:
Line 156: Line 206:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L344 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 344
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L713 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 713
*Signature: static public function getMechanismByStorage($storage)
*Signature: static public function getMechanismByStorage($storage)
*Parameters:
*Parameters:
Line 162: Line 212:
*Returns: [[Class: I2CE_FormStorage_Mechanism (Development) | I2CE_FormStorage_Mechanism]]<br/>or false on failure
*Returns: [[Class: I2CE_FormStorage_Mechanism (Development) | I2CE_FormStorage_Mechanism]]<br/>or false on failure
===getMethods()===
===getMethods()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L47 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 47
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L126 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 126
*Signature: static public function getMethods()
*Signature: static public function getMethods()
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L462 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 462
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L840 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 840
*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 177: Line 227:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L439 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 439
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L811 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 811
*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 188: Line 238:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L388 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 388
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L760 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 760
*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 199: Line 249:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1387 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1387
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1961 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1961
*Signature: public function getRecords($factory,$form_name)
*Signature: public function getRecords($factory,$form_name)
*Parameters:
*Parameters:
Line 207: Line 257:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L301 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 301
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L663 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 663
*Signature: static public function getStorage($form_name,$no_cache)
*Signature: static public function getStorage($form_name,$no_cache)
*Parameters:
*Parameters:
Line 215: Line 265:
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getStorageMechanism()===
===getStorageMechanism()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L331 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 331
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L700 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 700
*Signature: static public function getStorageMechanism($form_name,$no_cache)
*Signature: static public function getStorageMechanism($form_name,$no_cache)
*Parameters:
*Parameters:
Line 222: Line 272:
***Default Value: false  
***Default Value: false  
*Returns: [[Class: I2CE_FormStorage_Mechanism (Development) | I2CE_FormStorage_Mechanism]]<br/>or false on failure
*Returns: [[Class: I2CE_FormStorage_Mechanism (Development) | I2CE_FormStorage_Mechanism]]<br/>or false on failure
===globalChangeParent()===
method to remap a given id
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L195 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 195
*Signature: public function globalChangeParent($form,$oldid,$newid)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form
** [http://www.php.net/manual/en/language.types.string.php string ] $oldid
** [http://www.php.net/manual/en/language.types.string.php string ] $newid
===globalChangeParent_hook()===
Hooked method update all all parent fields refering to a given id
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L181 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 181
*Signature: public function globalChangeParent_hook($args)
*Parameters:
**$args
===globalFieldUpdate()===
method to remap all instances of given field on a given form and field @param $fieldObj I2CE_FormField
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L232 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 232
*Signature: public function globalFieldUpdate($fieldObj,$where,$set_func,$set_sql)
*Parameters:
**$fieldObj
** [http://www.php.net/manual/en/language.types.array.php array ] $where <br/>Array of where data
** callable $set_func <br/>the php used to update the field
** [http://www.php.net/manual/en/language.types.string.php string ] $set_sql <br/>Optional. sql used to update the field.  Defaults to false.  If present used by DB like form storage mechansims to do a global update rather than a record by record
***Default Value: false
===hasColumn()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L76 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 76
*Signature: protected function hasColumn($col,$table)
*Parameters:
**$col
**$table
===hasRecord()===
Checks if the given record exists.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1987 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1987
*Signature: public function hasRecord($factory,$form_name,$form_id)
*Parameters:
** [[Class: I2CE_FormFactory (Development) | I2CE_FormFactory]] $factory
** [http://www.php.net/manual/en/language.types.string.php string ] $form_name
** [http://www.php.net/manual/en/language.types.string.php string ] $form_id
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
===importData()===
===importData()===
Move data for a form from one storage mechansim to another @param I2CE_FormStorage_Mechansim $target
Move data for a form from one storage mechansim to another @param I2CE_FormStorage_Mechansim $target
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L233 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 233
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L520 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 520
*Signature: static public function importData($form,$source,$user,$ids)
*Signature: static public function importData($form,$source,$user,$ids)
*Parameters:
*Parameters:
Line 235: Line 324:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L248 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 248
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L587 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 587
*Signature: static public function isComponentized($form)
*Signature: static public function isComponentized($form)
*Parameters:
*Parameters:
Line 242: Line 331:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L884 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 884
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1278 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1278
*Signature: public function isComponentizedForm($formClass)
*Signature: public function isComponentizedForm($formClass)
*Parameters:
*Parameters:
Line 249: Line 338:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1410 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1410
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L2013 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 2013
*Signature: static public function isWritable($form)
*Signature: static public function isWritable($form)
*Parameters:
*Parameters:
Line 255: Line 344:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L856 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 856
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1246 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1246
*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,$use_cache,$user)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The form name
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The form name
Line 270: Line 359:
** integer $mod_time <br/>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.
** integer $mod_time <br/>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
***Default Value: -1
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $use_cache <br/>Use the cached form for data if it's available.
***Default Value: false
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $user <br/>The user id of the user to limit the results to so it only returns results limited to that user.  This can be a single value or an array
***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.
===listFields()===
===listFields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L829 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 829
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1213 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1213
*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,$use_cache)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The form name
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The form name
Line 287: Line 380:
** integer $mod_time <br/>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.
** integer $mod_time <br/>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
***Default Value: -1
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $use_cache <br/>Use the cached form for data if it's available.
***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.
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L800 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 800
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1183 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1183
*Signature: static public function lookupDisplayField($form,$id,$fields,$delim)
*Signature: static public function lookupDisplayField($form,$id,$fields,$delim)
*Parameters:
*Parameters:
Line 298: Line 393:
***Default Value: array('name')
***Default Value: array('name')
** [http://www.php.net/manual/en/language.types.string.php string ] $delim <br/>The delimiter to put between returned fields if there are more than one.  If false , then we return as an array.  Defaults to '-'
** [http://www.php.net/manual/en/language.types.string.php string ] $delim <br/>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: '-'
***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
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L773 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 773
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1156 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1156
*Signature: static public function lookupField($form,$id,$fields,$delim)
*Signature: static public function lookupField($form,$id,$fields,$delim)
*Parameters:
*Parameters:
Line 314: Line 409:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L663 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 663
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1043 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1043
*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 324: Line 419:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L500 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 500
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L878 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 878
*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 343: Line 438:
===moveData()===
===moveData()===
Move data for a form from one storage mechansim to another
Move data for a form from one storage mechansim to another
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L169 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 169
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L453 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 453
*Signature: static public function moveData($form,$source,$target,$user,$ids)
*Signature: static public function moveData($form,$source,$target,$user,$ids)
*Parameters:
*Parameters:
Line 355: Line 450:
===populate()===
===populate()===
Use method to populate a form object.
Use method to populate a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L905 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 905
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1300 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1300
*Signature: public function populate($form)
*Signature: public function populate($form,$repopulate)
*Parameters:
*Parameters:
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $repopulate <br/>Defaults to 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 ]
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1084 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1084
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1520 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1520
*Signature: public function populateChild($form,$form_name,$order_by,$where,$type)
*Signature: public function populateChild($form,$form_name,$order_by,$where,$type,$limit)
*Parameters:
*Parameters:
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
** [[Class: I2CE_Form (Development) | I2CE_Form]] $form
Line 373: Line 470:
** [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'  
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $limit <br/>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
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1127 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1127
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1570 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1570
*Signature: public function populateChildren($form,$forms,$orderBy)
*Signature: public function populateChildren($form,$forms,$orderBy)
*Parameters:
*Parameters:
Line 384: Line 483:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1001 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1001
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1432 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1432
*Signature: public function populateFirst($form,$forms)
*Signature: public function populateFirst($form,$forms)
*Parameters:
*Parameters:
Line 392: Line 491:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L940 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 940
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1371 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1371
*Signature: public function populateHistory($form)
*Signature: public function populateHistory($form)
*Parameters:
*Parameters:
Line 398: Line 497:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L954 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 954
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1385 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1385
*Signature: public function populateLast($form,$forms)
*Signature: public function populateLast($form,$forms)
*Parameters:
*Parameters:
Line 404: Line 503:
** [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()
===recursiveEncode64()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1798 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1798
*Signature: protected function recursiveEncode64($data)
*Parameters:
**&$data
===releaseStorage()===
Release the form storage associated to a form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L641 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 641
*Signature: static public function releaseStorage($form)
*Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $form <br/>Either a string, theform name, or an I2CE_Form
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===removeFromPopulatedList()===
remove a form from the "its already been populated cache"
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1323 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1323
*Signature: public function removeFromPopulatedList($form)
*Parameters:
**$form
===save()===
===save()===
User method to save a form object.
User method to save a form object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1182 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1182
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1686 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1686
*Signature: public function save($form,$user,$transact)
*Signature: public function save($form,$user,$transact)
*Parameters:
*Parameters:
Line 415: Line 532:
*Returns: boolean.<br/>true on success
*Returns: boolean.<br/>true on success
===search()===
===search()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L732 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 732
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1115 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1115
*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 430: Line 547:
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1160 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1160
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1603 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1603
*Signature: public function setChangeType($form,$change_type,$field)
*Signature: public function setChangeType($form,$change_type,$field)
*Parameters:
*Parameters:
Line 440: Line 557:
===setLastListCount()===
===setLastListCount()===
Add the last results from a search query for a form.
Add the last results from a search query for a form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1441 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1441
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L2044 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 2044
*Signature: static public function setLastListCount($form,$count)
*Signature: static public function setLastListCount($form,$count)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The form name
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>The form name
** integer $count <br/>The number of results.
** integer $count <br/>The number of results.
===storeHistory()===
Store the history for a form I2CE_Form $form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L1762 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 1762
*Signature: public function storeHistory($form)
*Parameters:
**$form
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L367 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 367
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L736 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 736
*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
===upgrade()===
Upgrade module method
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L61 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 61
*Signature: public function upgrade($old_vers,$new_vers)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $old_vers
** [http://www.php.net/manual/en/language.types.string.php string ] $new_vers
===upgradeFormStore()===
upgrade the fom history storage table to add version
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L105 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 105
*Signature: protected function upgradeFormStore()
*Returns: boolean.<br/>true on success
===validate_form()===
Hooked Function to check if the set of values of a form are unique @param I2CE_Form $formobj
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L274 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 274
*Signature: public function validate_form($form_obj)
*Parameters:
**$form_obj
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===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-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L94 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 94
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php#L344 i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php] on line 344
*Signature: public function validate_formfield($field_obj)
*Signature: public function validate_formfield($field_obj)
*Parameters:
*Parameters:
Line 471: Line 613:
===action_enable()===
===action_enable()===
This public method is inherited from [[Class: I2CE_Module (Development)#action_enable() | I2CE_Module->action_enable()]]
This public method is inherited from [[Class: I2CE_Module (Development)#action_enable() | I2CE_Module->action_enable()]]
===action_initialize()===
This public method is inherited from [[Class: I2CE_Module (Development)#action_initialize() | I2CE_Module->action_initialize()]]
===getCLIHooks()===
This public method is inherited from [[Class: I2CE_Module (Development)#getCLIHooks() | I2CE_Module->getCLIHooks()]]


===getCLIMethods()===
===getCLIMethods()===
Line 489: Line 625:
===pre_upgrade()===
===pre_upgrade()===
This public method is inherited from [[Class: I2CE_Module (Development)#pre_upgrade() | I2CE_Module->pre_upgrade()]]
This public method is inherited from [[Class: I2CE_Module (Development)#pre_upgrade() | I2CE_Module->pre_upgrade()]]
===upgrade()===
This public method is inherited from [[Class: I2CE_Module (Development)#upgrade() | I2CE_Module->upgrade()]]


===_hasMethod()===
===_hasMethod()===

Latest revision as of 08:14, 6 May 2015


This article describes the class I2CE_FormStorage .

I2CE_Module_FormStorage

Variables

$lastListCount

A list of forms with the last count returned for listDisplayFields

$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

$populated_list

$store_stmt

Insert statment for storing form history

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.

_populate()

Internal worker method to populate a form object.

_save()

Internal worker method to save a form object.

action_initialize()

Method called when the module is enabled for the first time. @param boolean -- returns true on success. false on error.

addChild()

add the given child to the form for this object.

changeFormID()

Change the id of the given form

changeID()

Change the id of the given form @param I2CE_Form $formObj

delete()

Delete a form object.

duplicate()

Use method to duplicate a form object.

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 535
  • Signature: public function duplicate($form,$recurse,$save,$parentid,$user)
  • Parameters:
    • I2CE_Form $form
    • boolean $recurse
      Defaults to false. If true we duplicate all children, and {@param $save is forced to be true}
      • Default Value: false
    • boolean $save
      Defaults to true. If true we save the form at the same time we duplicate it.
      • Default Value: true
    • string $parentid
      Defaults to null in which case the parent id of the duplicated form is not set
      • Default Value: null
    • I2CE_User $user
      the user object to save. Defaults to null.
      • Default Value: null
  • Returns: mixed
    false on error or I2CE_Form, the duplicated form

exportData()

Move data for a form from one storage mechansim to another

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 505
  • Signature: static public function exportData($form,$target,$user,$ids)
  • Parameters:
    • string $form
      The form
    • I2CE_FormStorage_Mechansim $target
    • I2CE_User $user
      The user object used to save the data to the target storage mechanism
    • mixed $ids
      An id or an array of the ids we wish to move. Defaults to null, in which case all id's are moved
      • Default Value: null
  • Returns: boolean.
    true on success

form_cleanup()

Hooked form cleanup method

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

getLastListCount()

Return the last results from a search query for a form.

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

globalChangeParent()

method to remap a given id

globalChangeParent_hook()

Hooked method update all all parent fields refering to a given id

globalFieldUpdate()

method to remap all instances of given field on a given form and field @param $fieldObj I2CE_FormField

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 232
  • Signature: public function globalFieldUpdate($fieldObj,$where,$set_func,$set_sql)
  • Parameters:
    • $fieldObj
    • array $where
      Array of where data
    • callable $set_func
      the php used to update the field
    • string $set_sql
      Optional. sql used to update the field. Defaults to false. If present used by DB like form storage mechansims to do a global update rather than a record by record
      • Default Value: false

hasColumn()

hasRecord()

Checks if the given record exists.

importData()

Move data for a form from one storage mechansim to another @param I2CE_FormStorage_Mechansim $target

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 1246
  • Signature: static public function listDisplayFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time,$use_cache,$user)
  • Parameters:
    • string $form
      The form name
    • array $fields
      of string. The fields we want returned Can include the special field 'last_modified' to get the last modification time for any of the fields of that form which is returned in the format "Y-m-d H:i:s"
    • 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
    • boolean $use_cache
      Use the cached form for data if it's available.
      • Default Value: false
    • mixed $user
      The user id of the user to limit the results to so it only returns results limited to that user. This can be a single value or an array
      • 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.

listFields()

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 1213
  • Signature: static public function listFields($form,$fields,$parent,$where_data,$ordering,$limit,$mod_time,$use_cache)
  • Parameters:
    • string $form
      The form name
    • array $fields
      of string. The fields we want returned. Can include the special field 'last_modified' to get the last modification time for any of the fields of that form which is returned in the format "Y-m-d H:i:s"
    • 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
    • boolean $use_cache
      Use the cached form for data if it's available.
      • 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.

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 1183
  • 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 1156
  • 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 1043
  • 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 878
  • 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

moveData()

Move data for a form from one storage mechansim to another

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 453
  • Signature: static public function moveData($form,$source,$target,$user,$ids)
  • Parameters:
    • string $form
      The form
    • I2CE_FormStorage_Mechansim $source
    • I2CE_FormStorage_Mechansim $target
    • I2CE_User $user
      The user object used to save the data to the target storage mechanism
    • mixed $ids
      An id or an array of the ids we wish to move. Defaults to null, in which case all id's are moved
      • Default Value: null
  • Returns: boolean.
    true on success

populate()

Use method to 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 1520
  • Signature: public function populateChild($form,$form_name,$order_by,$where,$type,$limit)
  • 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'
    • 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

populateChildren()

Populate the given child form for this object.

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

recursiveEncode64()

releaseStorage()

Release the form storage associated to a form

removeFromPopulatedList()

remove a form from the "its already been populated cache"

save()

User method to save a form object.

search()

  • Defined in i2ce/modules/Forms/modules/FormStorage/lib/I2CE_FormStorage.php on line 1115
  • 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 1603
  • 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'

setLastListCount()

Add the last results from a search query for a form.

storeHistory()

Store the history for a form I2CE_Form $form

storeMigrateData()

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

upgrade()

Upgrade module method

upgradeFormStore()

upgrade the fom history storage table to add version

validate_form()

Hooked Function to check if the set of values of a form are unique @param I2CE_Form $formobj

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

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

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