Class: I2CE FormRelationship (4.1.7)

From IHRIS Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


This article describes the class I2CE_FormRelationship .

I2CE_CustomRelationship

Variables

$primaryForm

$primaryFormName

$parentFormNames

$formConfigs

$relationship

$relConfig

$form_reference

$use_cache

Defatuls to true. Set to use cache for getting values in relationship hierarchy

$use_disp_fields

@var boolean $use_displ_fields. Defaults to true. Whether or not to return the display fields when getting relationship data

$funcDetails

$operands

array $operands of string. The SQL operands recognzied

$additional_limits

An array, indexed by report form names, of additional limits that are set for a relationship

Methods

__construct()

_getFunctionDetails()

Get the array of function details at the specified for the specified function at the speci @var I2CE_MagicDataNode $funcConfig @var array $dependents A list of functions this function depends on

_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

_walkSatisfyingForms()

Worker method to walk relationship hierarchy to get joined forms in relationship

addParentIdToWhereClause()

disableCaching()

to no use cache for getting values in relationship hierarchy

enableCaching()

to use cache for getting values in relationship hierarchy

evaluateFunction()

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

formSatisfiesRelationship()

Checks to see if a given named form and id satisfies the relationship for the given primary form @param string $namedFormId. The id of the named form we wish to check. Can be either "$form|$id" oe "$id"

generateWhereClause()

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

getAdditionalLimits()

Modifty the given where clause, if any, based on any additional limits that have been set for the named form

getAncestorFormNames()

Get the named forms in the relationship which are ancestral to the given named form

getChildFormNames()

Get the named forms for the given named form upto a specified depth

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

getFormData()

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 1671
  • Signature: public function getFormData($form,$id,$fields,$ordering,$as_iterator)
  • Parameters:
    • $form
    • string $id
      the id of the primary form
    • array $fields
      keys are relationship formnames, values are array of fields we wan returned
      • Default Value: array()
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
      • Default Value: array()
    • $as_iterator
      • Default Value: true
  • 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

getFormDataJoiningByID()

Find all form ids matching the given join

getFormDataJoiningByID_child()

Get the forms ids for joining on the named parent forms if with the parent of the named child form

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 2047
  • Signature: public function getFormDataJoiningByID_child($childFormName,$parentForm,$parentId,$joinData,$where,$limit,$fields,$ordering)
  • Parameters:
    • string $childFormName
      the name of the child form in the relationship
    • string $parentForm
    • string $parentId
    • array $joinData
      The array containg the join data
    • array $where
    • array $limit
    • array $fields
      keys are relationship formnames, values are array of fields we want returned
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
  • Returns: mixed.
    An array of form ids

getFormDataJoiningByID_child_field()

Get the forms ids for joining on the named parent form's id with the named child form on a given field

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 2089
  • Signature: public function getFormDataJoiningByID_child_field($childFormName,$parentForm,$parentId,$joinData,$where,$limit,$fields,$ordering)
  • Parameters:
    • string $childFormName
      the name of the child form in the relationship
    • string $parentForm
    • string $parentId
    • array $joinData
      The array containg the join data
    • array $where
    • array $limit
    • array $fields
      keys are relationship formnames, values are array of fields we want returned
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
  • Returns: mixed.
    An array of form ids

getFormDataJoiningByID_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

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 2139
  • Signature: public function getFormDataJoiningByID_fields($childFormName,$parentForm,$parentId,$joinData,$where,$limit,$fields,$ordering)
  • Parameters:
    • string $childFormName
      the name of the child form in the relationship
    • string $parentForm
    • string $parentId
    • array $joinData
      The array containg the join data
    • array $where
    • array $limit
    • array $fields
      keys are relationship formnames, values are array of fields we want returned
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
  • Returns: mixed.
    An array of form ids

getFormDataJoiningByID_ids()

Get the forms ids for joining on ids of the named parent/child forms

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 2007
  • Signature: public function getFormDataJoiningByID_ids($childFormName,$parentForm,$parentId,$joinData,$where,$limit,$fields,$ordering)
  • Parameters:
    • string $childFormName
      the name of the child form in the relationship
    • string $parentForm
    • string $parentId
    • array $joinData
      The array containg the join data
    • array $where
    • array $limit
    • array $fields
      keys are relationship formnames, values are array of fields we want returned
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
  • Returns: mixed.
    An array of form ids

getFormDataJoiningByID_parent()

Get the forms ids for joining as the named child form's id with the parent of the named parent form

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 1912
  • Signature: public function getFormDataJoiningByID_parent($childFormName,$parentForm,$parentId,$joinData,$where,$limit,$fields,$ordering)
  • Parameters:
    • string $childFormName
      the name of the child form in the relationship
    • string $parentForm
    • string $parentId
    • array $joinData
      The array containg the join data
    • array $where
    • array $limit
    • array $fields
      keys are relationship formnames, values are array of fields we want returned
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
  • Returns: mixed.
    An array of form ids

getFormDataJoiningByID_parent_field()

Get the forms ids for joining as a named child form's id with the named parent form on a given field

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 1956
  • Signature: public function getFormDataJoiningByID_parent_field($childFormName,$parentForm,$parentId,$joinData,$where,$limit,$fields,$ordering)
  • Parameters:
    • string $childFormName
      the name of the child form in the relationship
    • string $parentForm
    • string $parentId
    • array $joinData
      The array containg the join data
    • array $where
    • array $limit
    • array $fields
      keys are relationship formnames, values are array of fields we want returned
    • array $ordering
      keys are relationship formnames, values are array of fields we want ordered by
  • Returns: mixed.
    An array of form ids

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

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

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

getFormIdsJoiningOn_ids()

Get the forms ids for joining on ids of the named parent/child forms

getFormIdsJoiningOn_parent()

Get the forms ids for joining as the named child form's id with the parent of the named parent form

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

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 366
  • Signature: public function getFormsSatisfyingRelationship($form_id)
  • Parameters:
    • mixed $form_id
      Either an I2CE_Form instnace, 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 661
  • Signature: public function getFunctionDetails($functions)
  • Parameters:
    • mixed $functions
      string or an array of string
  • 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

getFunctionDetailsWalker()

Walks the function data tree to creates the list of function details

getJoin()

Get the SQL join statemetn for the given form

getJoiningFields()

getLimitingFields()

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

getLinkingData()

Get linking data, if any, for the indicated field of the named form @param string $joinForm the named form we are trying to join

  • Defined in i2ce/modules/Forms/modules/FormRelationship/lib/I2CE_FormRelationship.php on line 862
  • Signature: protected function getLinkingData($formName,$fieldName,$joinFormName,$joinField,$style,$reversed,$primary_table)
  • Parameters:
    • string $formName
      The named form in the relationship
    • string $fieldName
      The field name
    • $joinFormName
    • string $joinField
      The field of the joined form we are looking for
    • $style
      • Default Value: 'default'
    • $reversed
      • Default Value: false
    • $primary_table
      • Default Value: 'primary_table'
  • Returns: mixed
    If no linking data then return false. Otherwise is in an array with keys sub_select, forms and fields

getParentFormNames()

Get the name(s) of parent forms

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

getRelationship()

getRequiredForms()

Gets the forms required by the relationship

hasAncestor()

Determine if the form name given has ancestral conditions.

isJoin()

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

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

isRightJoin()

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

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 @param string $childForm the name of the child form in the relationship

limitOne()

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

setAdditionalLimit()

useDisplayFields()

Set the relationship to use the display fields when getting form data

useRawFields()

Set the relationship to use the raw data when getting form data

usesRawFields()

check if the relationship to use the raw data when getting form data

Inherited Methods

_hasMethod()

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

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()