Class: I2CE FormRelationship (Development): Difference between revisions

From IHRIS Wiki
(Created page with '{{otherversions|Class: I2CE_FormRelationship}} This article describes the class ''I2CE_FormRelationship'' . *Extends the class: I2CE_Fuzzy. …')
 
No edit summary
Line 36: Line 36:


===$operands===
===$operands===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L182 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 182
array $operands of string.  The SQL operands recognzied
*Type: static protected $operands
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L461 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 461
*Type: static protected static $operands


==Methods==
==Methods==
===__construct()===
===__construct()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L46 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 46
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L46 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 46
*Signature: public function __construct($relationship,$form_reference,$relationship_base)
*Signature: public function __construct($relationship,$relationship_base,$form_reference)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $relationship
** [http://www.php.net/manual/en/language.types.string.php string ] $relationship
**$relationship_base
***Default Value: '/modules/CustomReports/relationships'
** [http://www.php.net/manual/en/language.pseudo-types.php callback ] $form_reference
** [http://www.php.net/manual/en/language.pseudo-types.php callback ] $form_reference
**$relationship_base
***Default Value: null
===_getLimitingFields()===
===_getLimitingFields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L197 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 197
internal function to get the fields which are in the limits for one where clause in a relationship @param array $limited_fields array of boolean indexed by the names of the fields
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L486 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 486
*Signature: protected function _getLimitingFields($whereConfig,$limiting_fields)
*Signature: protected function _getLimitingFields($whereConfig,$limiting_fields)
*Parameters:
*Parameters:
**$whereConfig  
** [[Class: I2CE_MagicDataNode (Development) | I2CE_MagicDataNode]] $whereConfig
**&$limiting_fields  
**&$limiting_fields  
===addParentIdToWhereClause()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L324 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 324
*Signature: protected function addParentIdToWhereClause($where,$parent_id)
*Parameters:
**&$where
**$parent_id
===dropEmpty()===
Determine if we should consider a relationship to not be satisifed if there is no form for the given named form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L188 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 188
*Signature: public function dropEmpty($formName)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $formName
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===evaluateFunction()===
Evaluate a given relationship function on the given form data @param string $funciton
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L401 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 401
*Signature: public function evaluateFunction($function,$formData,$displayValue)
*Parameters:
**$function
** [http://www.php.net/manual/en/language.types.array.php array ] $formData <br/>of I2CE_Form as returend by the @getFormsSatisfyingRelationship()
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $displayValue <br/>Defaults to true, in which case it returns the display value of the function.  If false, it returns the DB value
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===generateWhereClause()===
===generateWhereClause()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L224 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 224
Generate the where clause for the join of a given named form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L518 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 518
*Signature: public function generateWhereClause($formName)
*Signature: public function generateWhereClause($formName)
*Parameters:
*Parameters:
**$formName  
** [http://www.php.net/manual/en/language.types.string.php string ] $formName
*Returns: mixed.<br/>false on failure or a SQL string on success
===getForm()===
===getForm()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L62 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 62
Returns the form for a given named form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L69 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 69
*Signature: public function getForm($formname)
*Signature: public function getForm($formname)
*Parameters:
*Parameters:
**$formname  
** [http://www.php.net/manual/en/language.types.string.php string ] $formname
*Returns: mixed.<br/>A string, the form, on success. false on failure
===getFormConfig()===
===getFormConfig()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L100 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 100
Get the magic data node(s) for the name form in the relationship @param string $form.
*Signature: public function getFormConfig($form)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L120 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 120
*Signature: public function getFormConfig($formname)
*Parameters:
*Parameters:
**$form
**$formname
***Default Value: null
***Default Value: null
*Returns: mixed.<br/>false on failture.  If $forname is null, we return an array of I2CE_MagicDataNodes index by the form names.  If $formma,e is a string then we return the  config for the named form.
===getFormIdsJoiningOn()===
Find all form ids matching the given join
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L282 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 282
*Signature: public function getFormIdsJoiningOn($formName,$parentFormObj,$only_first_match)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $formName <br/>The named form
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj <br/>The populated form object of the named parent form in the relationship
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $only_first_match <br/>Defaults to true in which case we only return the first matching form
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the form ids
===getFormIdsJoiningOn_child()===
Get the forms ids for joining  on the named parent forms if with the parent of the named child form @param string $childForm the name of the child form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L662 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 662
*Signature: public function getFormIdsJoiningOn_child($formName,$parentFormObj,$joinData,$where,$limit)
*Parameters:
**$formName
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
** [http://www.php.net/manual/en/language.types.array.php array ] $where
** [http://www.php.net/manual/en/language.types.array.php array ] $limit
*Returns: mixed.<br/>An array of form ids
===getFormIdsJoiningOn_child_field()===
Get the forms ids  for joining on the named parent form's id with the named child form on a given field @param string $childForm the name of the child form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L708 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 708
*Signature: public function getFormIdsJoiningOn_child_field($formName,$parentFormObj,$joinData,$where,$limit)
*Parameters:
**$formName
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
** [http://www.php.net/manual/en/language.types.array.php array ] $where
** [http://www.php.net/manual/en/language.types.array.php array ] $limit
*Returns: mixed.<br/>An array of form ids
===getFormIdsJoiningOn_fields()===
Get the forms ids for joining on a given field of  a named child form's with the named parent form on a given field @param string $childForm the name of the child form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L842 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 842
*Signature: public function getFormIdsJoiningOn_fields($formName,$parentFormObj,$joinData,$where,$limit)
*Parameters:
**$formName
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
** [http://www.php.net/manual/en/language.types.array.php array ] $where
** [http://www.php.net/manual/en/language.types.array.php array ] $limit
*Returns: mixed.<br/>An array of form ids
===getFormIdsJoiningOn_ids()===
Get the forms ids for joining on ids of the named parent/child forms @param string $childForm the name of the child form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L577 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 577
*Signature: public function getFormIdsJoiningOn_ids($formName,$parentFormObj,$joinData,$where,$limit)
*Parameters:
**$formName
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
** [http://www.php.net/manual/en/language.types.array.php array ] $where
** [http://www.php.net/manual/en/language.types.array.php array ] $limit
*Returns: mixed.<br/>An array of form ids
===getFormIdsJoiningOn_parent()===
Get the forms ids for joining as the named child form's id with the parent  of the named parent form @param string $childForm the name of the child form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L618 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 618
*Signature: public function getFormIdsJoiningOn_parent($formName,$parentFormObj,$joinData,$where,$limit)
*Parameters:
**$formName
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
** [http://www.php.net/manual/en/language.types.array.php array ] $where
** [http://www.php.net/manual/en/language.types.array.php array ] $limit
*Returns: mixed.<br/>An array of form ids
===getFormIdsJoiningOn_parent_field()===
Get the forms ids for joining as a named child form's id with the named parent form on a given field @param string $childForm the name of the child form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L774 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 774
*Signature: public function getFormIdsJoiningOn_parent_field($formName,$parentFormObj,$joinData,$where,$limit)
*Parameters:
**$formName
** [[Class: I2CE_Form (Development) | I2CE_Form]] $parentFormObj
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
** [http://www.php.net/manual/en/language.types.array.php array ] $where
** [http://www.php.net/manual/en/language.types.array.php array ] $limit
*Returns: mixed.<br/>An array of form ids
===getFormNames()===
===getFormNames()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L139 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 139
Get the names of the forms in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L179 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 179
*Signature: public function getFormNames()
*Signature: public function getFormNames()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string.
===getForms()===
===getForms()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L88 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 88
Internal method to walk the relationship and get all the form configs and parent form names and store them in  arrays
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L102 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 102
*Signature: protected function getForms($config,$formConfigs,$parentForms,$parent_form_name)
*Signature: protected function getForms($config,$formConfigs,$parentForms,$parent_form_name)
*Parameters:
*Parameters:
**$config  
** [[Class: I2CE_MagicDataNode (Development) | I2CE_MagicDataNode]] $config <br/>The node we are walking
**&$formConfigs  
** [http://www.php.net/manual/en/language.types.array.php array ] $formConfigs <br/>The array we are storing magic data nodes.  Indexed by named forms
**&$parentForms  
** [http://www.php.net/manual/en/language.types.array.php array ] $parentForms <br/>The array of string which maps the named parent form of a named form
**$parent_form_name  
** [http://www.php.net/manual/en/language.types.string.php string ] $parent_form_name <br/>The name of the parent form for the given $config
===getFormsSatisfyingRelationship()===
Get the forms that satisfy a relationship for the given primary form id
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L199 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 199
*Signature: public function getFormsSatisfyingRelationship($form_id)
*Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $form_id <br/>Either a string, the  form id or an array of string (priamry_form, id) for the primary form of the relationship
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of mixed.  The array may be empty if the $form_id  does not satisfy the relationship.  It is indexed by the named form and the form objects are already populated.  If there was no matching form for a given named form, then the value of the array elemet will be false
===getFunctionDetails()===
===getFunctionDetails()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L157 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 157
Get the details of a relationship function
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L368 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 368
*Signature: public function getFunctionDetails($function)
*Signature: public function getFunctionDetails($function)
*Parameters:
*Parameters:
**$function  
** [http://www.php.net/manual/en/language.types.string.php string ] $function
*Returns: mixed.<br/>false on failure.  On success an array with the keys 'qry' the query string, 'type' the return SQL type of the function, 'required_fields' the form fields reuquired in the relationship,  and 'field' which is an instance of I2CE_FormField for the function
===getJoin()===
===getJoin()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L334 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 334
Get the SQL join statemetn for the given form @param string the named form in the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L893 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 893
*Signature: public function getJoin($formName)
*Signature: public function getJoin($formName)
*Parameters:
*Parameters:
**$formName  
**$formName  
*Returns: mixed.<br/>String, the SQL join statements on succes, false on failure
===getLimitingFields()===
===getLimitingFields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L184 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 184
Gets the names of the fields which are in a limit for a where clause of a given form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L468 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 468
*Signature: public function getLimitingFields($formName)
*Signature: public function getLimitingFields($formName)
*Parameters:
*Parameters:
**$formName  
** [http://www.php.net/manual/en/language.types.string.php string ] $formName <br/>The anmed form in the relationship
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string, the fields that are present in the limit
===getParentFormNames()===
===getParentFormNames()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L112 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 112
Get the name(s) of parent forms
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L138 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 138
*Signature: public function getParentFormNames($formname)
*Signature: public function getParentFormNames($formname)
*Parameters:
*Parameters:
**$formname  
** [http://www.php.net/manual/en/language.types.string.php string ] $formname
***Default Value: null
***Default Value: null
*Returns: mixed.<br/>If $formname is  null we return an array index by relationship form names of all the parent forms.  If $formname is a string, it is the parentform name, if it exists of false otherwise.
===getPrimaryForm()===
===getPrimaryForm()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L126 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 126
Get the primary form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L154 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 154
*Signature: public function getPrimaryForm()
*Signature: public function getPrimaryForm()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getPrimaryFormName()===
===getPrimaryFormName()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L130 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 130
Gets the name of the primary from (e.g. the  name of the relationship)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L162 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 162
*Signature: public function getPrimaryFormName()
*Signature: public function getPrimaryFormName()
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getReferencedForm()===
===getReferencedForm()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L146 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 146
Get the SQL name of a form via the registered callback functin
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L348 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 348
*Signature: public function getReferencedForm($form)
*Signature: public function getReferencedForm($form)
*Parameters:
*Parameters:
**$form  
** [http://www.php.net/manual/en/language.types.string.php string ] $form
*Returns: mixed.<br/>False on failure. A string on success
===getReferenedForm()===
===getReferenedForm()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L252 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 252
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L546 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 546
*Signature: public function getReferenedForm($form)
*Signature: public function getReferenedForm($form)
*Parameters:
*Parameters:
Line 119: Line 252:
===getRequiredForms()===
===getRequiredForms()===
Gets the forms required by the relationship
Gets the forms required by the relationship
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L77 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 77
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L84 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 84
*Signature: public function getRequiredForms()
*Signature: public function getRequiredForms()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string
===isPrimaryFormName()===
===isPrimaryFormName()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L133 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 133
Check to see if the given form name is the primary form name.  Note the primary form name is the same as the relationship name
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L170 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 170
*Signature: public function isPrimaryFormName($formname)
*Signature: public function isPrimaryFormName($formname)
*Parameters:
*Parameters:
**$formname  
** [http://www.php.net/manual/en/language.types.string.php string ] $formname
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===joinOn_child()===
===joinOn_child()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L277 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 277
Generate SQL join statement for joining  on the named parent forms if with the parent of the named child form
*Signature: protected function joinOn_child($childForm,$joinData)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L647 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 647
*Signature: public function joinOn_child($childForm,$joinData)
*Parameters:
*Parameters:
**$childForm  
** [http://www.php.net/manual/en/language.types.string.php string ] $childForm <br/>the name of the child form in the relationship
**$joinData  
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
*Returns: mixed.<br/>On success, a string which is the SQL join statement.  On failure, false
===joinOn_child_field()===
===joinOn_child_field()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L285 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 285
Generate SQL join statement for joining on the named parent form's id with the named child form on a given field
*Signature: protected function joinOn_child_field($childForm,$joinData)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L686 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 686
*Signature: public function joinOn_child_field($childForm,$joinData)
*Parameters:
*Parameters:
**$childForm  
** [http://www.php.net/manual/en/language.types.string.php string ] $childForm <br/>the name of the child form in the relationship
**$joinData  
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
*Returns: mixed.<br/>On success, a string which is the SQL join statement.  On failure, false
===joinOn_fields()===
===joinOn_fields()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L314 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 314
Generate SQL join statement for joining on a given field of  a named child form's with the named parent form on a given field
*Signature: protected function joinOn_fields($childForm,$joinData)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L815 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 815
*Signature: public function joinOn_fields($childForm,$joinData)
*Parameters:
*Parameters:
**$childForm  
** [http://www.php.net/manual/en/language.types.string.php string ] $childForm <br/>the name of the child form in the relationship
**$joinData  
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
*Returns: mixed.<br/>On success, a string which is the SQL join statement.  On failure, false
===joinOn_ids()===
===joinOn_ids()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L263 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 263
Generate SQL join statement for joining on ids of the named parent/child forms
*Signature: protected function joinOn_ids($childForm,$joinData)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L562 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 562
*Signature: public function joinOn_ids($childForm,$joinData)
*Parameters:
*Parameters:
**$childForm  
** [http://www.php.net/manual/en/language.types.string.php string ] $childForm <br/>the name of the child form in the relationship
**$joinData  
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
*Returns: mixed.<br/>On success, a string which is the SQL join statement.  On failure, false
===joinOn_parent()===
===joinOn_parent()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L270 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 270
Generate SQL join statement for joining as the named child form's id with the parent  of the named parent form
*Signature: protected function joinOn_parent($childForm,$joinData)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L603 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 603
*Signature: public function joinOn_parent($childForm,$joinData)
*Parameters:
*Parameters:
**$childForm  
** [http://www.php.net/manual/en/language.types.string.php string ] $childForm <br/>the name of the child form in the relationship
**$joinData  
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
*Returns: mixed.<br/>On success, a string which is the SQL join statement.  On failure, false
===joinOn_parent_field()===
===joinOn_parent_field()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L299 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 299
Generate SQL join statement for joining as a named child form's id with the named parent form on a given field
*Signature: protected function joinOn_parent_field($childForm,$joinData)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php#L752 i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php] on line 752
*Signature: public function joinOn_parent_field($childForm,$joinData)
*Parameters:
*Parameters:
**$childForm  
** [http://www.php.net/manual/en/language.types.string.php string ] $childForm <br/>the name of the child form in the relationship
**$joinData  
** [http://www.php.net/manual/en/language.types.array.php array ] $joinData <br/>The array containg the join data
*Returns: mixed.<br/>On success, a string which is the SQL join statement.  On failure, false
==Inherited Methods==
==Inherited Methods==
===_hasMethod()===
===_hasMethod()===

Revision as of 07:53, 27 May 2010


This article describes the class I2CE_FormRelationship .

I2CE_CustomRelationship

Variables

$primaryForm

$primaryFormName

$parentFormNames

$formConfigs

$relationship

$relConfig

$form_reference

$operands

array $operands of string. The SQL operands recognzied

Methods

__construct()

_getLimitingFields()

internal function to get the fields which are in the limits for one where clause in a relationship @param array $limited_fields array of boolean indexed by the names of the fields

addParentIdToWhereClause()

dropEmpty()

Determine if we should consider a relationship to not be satisifed if there is no form for the given named form

evaluateFunction()

Evaluate a given relationship function on the given form data @param string $funciton

generateWhereClause()

Generate the where clause for the join of a given named form

getForm()

Returns the form for a given named form in the relationship

getFormConfig()

Get the magic data node(s) for the name form in the relationship @param string $form.

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 120
  • Signature: public function getFormConfig($formname)
  • Parameters:
    • $formname
      • Default Value: null
  • Returns: mixed.
    false on failture. If $forname is null, we return an array of I2CE_MagicDataNodes index by the form names. If $formma,e is a string then we return the config for the named form.

getFormIdsJoiningOn()

Find all form ids matching the given join

getFormIdsJoiningOn_child()

Get the forms ids for joining on the named parent forms if with the parent of the named child form @param string $childForm the name of the child form in the relationship

getFormIdsJoiningOn_child_field()

Get the forms ids for joining on the named parent form's id with the named child form on a given field @param string $childForm the name of the child form in the relationship

getFormIdsJoiningOn_fields()

Get the forms ids for joining on a given field of a named child form's with the named parent form on a given field @param string $childForm the name of the child form in the relationship

getFormIdsJoiningOn_ids()

Get the forms ids for joining on ids of the named parent/child forms @param string $childForm the name of the child form in the relationship

getFormIdsJoiningOn_parent()

Get the forms ids for joining as the named child form's id with the parent of the named parent form @param string $childForm the name of the child form in the relationship

getFormIdsJoiningOn_parent_field()

Get the forms ids for joining as a named child form's id with the named parent form on a given field @param string $childForm the name of the child form in the relationship

getFormNames()

Get the names of the forms in the relationship

getForms()

Internal method to walk the relationship and get all the form configs and parent form names and store them in arrays

getFormsSatisfyingRelationship()

Get the forms that satisfy a relationship for the given primary form id

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 199
  • Signature: public function getFormsSatisfyingRelationship($form_id)
  • Parameters:
    • mixed $form_id
      Either a string, the form id or an array of string (priamry_form, id) for the primary form of the relationship
  • Returns: array
    of mixed. The array may be empty if the $form_id does not satisfy the relationship. It is indexed by the named form and the form objects are already populated. If there was no matching form for a given named form, then the value of the array elemet will be false

getFunctionDetails()

Get the details of a relationship function

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 368
  • Signature: public function getFunctionDetails($function)
  • Parameters:
  • Returns: mixed.
    false on failure. On success an array with the keys 'qry' the query string, 'type' the return SQL type of the function, 'required_fields' the form fields reuquired in the relationship, and 'field' which is an instance of I2CE_FormField for the function

getJoin()

Get the SQL join statemetn for the given form @param string the named form in the relationship

getLimitingFields()

Gets the names of the fields which are in a limit for a where clause of a given form

getParentFormNames()

Get the name(s) of parent forms

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 138
  • Signature: public function getParentFormNames($formname)
  • Parameters:
    • string $formname
      • Default Value: null
  • Returns: mixed.
    If $formname is null we return an array index by relationship form names of all the parent forms. If $formname is a string, it is the parentform name, if it exists of false otherwise.

getPrimaryForm()

Get the primary form

getPrimaryFormName()

Gets the name of the primary from (e.g. the name of the relationship)

getReferencedForm()

Get the SQL name of a form via the registered callback functin

getReferenedForm()

getRequiredForms()

Gets the forms required by the relationship

isPrimaryFormName()

Check to see if the given form name is the primary form name. Note the primary form name is the same as the relationship name

joinOn_child()

Generate SQL join statement for joining on the named parent forms if with the parent of the named child form

joinOn_child_field()

Generate SQL join statement for joining on the named parent form's id with the named child form on a given field

joinOn_fields()

Generate SQL join statement for joining on a given field of a named child form's with the named parent form on a given field

joinOn_ids()

Generate SQL join statement for joining on ids of the named parent/child forms

joinOn_parent()

Generate SQL join statement for joining as the named child form's id with the parent of the named parent form

joinOn_parent_field()

Generate SQL join statement for joining as a named child form's id with the named parent form on a given field

Inherited Methods

_hasMethod()

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

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()