Class: I2CE List: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 1: Line 1:
This article desrcibes the1 class '''I2CE_List''' which extends the class [[Class: I2CE_Form | I2CE_Form]]
This article desrcibes the1 class '''I2CE_List'''.
*Extends the class: [[Class: I2CE_Form | I2CE_Form]].
It is contained in the module [[iHRIS Module List#Lists|Lists]] in the package [https://launchpad.net/i2ce I2CE]
It is contained in the module [[iHRIS Module List#Lists|Lists]] in the package [https://launchpad.net/i2ce I2CE]


Line 44: Line 45:
*Signature: static protected function _monsterMash($options,$form_name,$opt_field,$opt_form,$opt_id,$sub_fields,$sub_val,$display_fields,$use_display_value)
*Signature: static protected function _monsterMash($options,$form_name,$opt_field,$opt_form,$opt_id,$sub_fields,$sub_val,$display_fields,$use_display_value)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.array.php array] &$options<br/>Where the id's are saved.  Array with keys the ids of $form_name. For values, if $use_dislpay_value is true, then
* [http://www.php.net/manual/en/language.types.array.php array ] &$options<br/>Where the id's are saved.  Array with keys the ids of $form_name. For values, if $use_dislpay_value is true, then
* [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_name
* stirng $opt_field<br/>The field we are limiting $form_name on.
* stirng $opt_field<br/>The field we are limiting $form_name on.
* stirng $opt_form<br/>The form we wish to look that $opt_field takes values in
* stirng $opt_form<br/>The form we wish to look that $opt_field takes values in
* [http://www.php.net/manual/en/language.types.string.php string] $opt_id<br/>The id wish to look that $opt_field takes values.  e.g. we are looking for all instances of $form_name where $opt_field  is $opt_form|$opt_id
* [http://www.php.net/manual/en/language.types.string.php string ] $opt_id<br/>The id wish to look that $opt_field takes values.  e.g. we are looking for all instances of $form_name where $opt_field  is $opt_form|$opt_id
* artary $sub_fields<br/>Example  array(county+district,district+region,[region])
* artary $sub_fields<br/>Example  array(county+district,district+region,[region])
* [http://www.php.net/manual/en/language.types.string.php string] $sub_val<br/>Defaults to ''.  If use_display_value is set, a string we prepend to the displayed fields for the id
* [http://www.php.net/manual/en/language.types.string.php string ] $sub_val<br/>Defaults to ''.  If use_display_value is set, a string we prepend to the displayed fields for the id
**Default Value: ''
**Default Value: ''
* [http://www.php.net/manual/en/language.types.array.php array] $display_fields<br/>The fields which we use to populate $options with.  Defaults to an empty array in which case the value of $options is the display fields registered for this form .
* [http://www.php.net/manual/en/language.types.array.php array ] $display_fields<br/>The fields which we use to populate $options with.  Defaults to an empty array in which case the value of $options is the display fields registered for this form .
**Default Value: array()
**Default Value: array()
*$use_display_value  
*$use_display_value  
Line 62: Line 63:
*Signature: static final protected function addCache($table_name,$id,$value)
*Signature: static final protected function addCache($table_name,$id,$value)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $table_name<br/>The name of the table in the database.
* [http://www.php.net/manual/en/language.types.string.php string ] $table_name<br/>The name of the table in the database.
*$id  
*$id  
* [http://www.php.net/manual/en/language.types.string.php string] $value<br/>The value to add to the cache
* [http://www.php.net/manual/en/language.types.string.php string ] $value<br/>The value to add to the cache
===componentizeQuery()===
===componentizeQuery()===
returns the posible componentization of a form|id
returns the posible componentization of a form|id
Line 71: Line 72:
*Returns: string. They query need to turn $qry into one componentized to $component.
*Returns: string. They query need to turn $qry into one componentized to $component.
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $qry<br/>the query need to get the form|id
* [http://www.php.net/manual/en/language.types.string.php string ] $qry<br/>the query need to get the form|id
* [http://www.php.net/manual/en/language.types.array.php array] $forms<br/>an array of string which are componentized
* [http://www.php.net/manual/en/language.types.array.php array ] $forms<br/>an array of string which are componentized
*$component  
*$component  
===createDataTree()===
===createDataTree()===
Line 82: Line 83:
*Signature: static public function createDataTree($fields,$forms,$limits,$orders,$display_first,$major_separator,$minor_separator)
*Signature: static public function createDataTree($fields,$forms,$limits,$orders,$display_first,$major_separator,$minor_separator)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.array.php array] $fields<br/>an ordered array E.g array('village+county','county','district,'region+country','country').
* [http://www.php.net/manual/en/language.types.array.php array ] $fields<br/>an ordered array E.g array('village+county','county','district,'region+country','country').
* [http://www.php.net/manual/en/language.types.array.php array] $forms<br/>An unorderd array of form names whose values we allow to be selected
* [http://www.php.net/manual/en/language.types.array.php array ] $forms<br/>An unorderd array of form names whose values we allow to be selected
* [http://www.php.net/manual/en/language.types.array.php array] $limits<br/>An array with keys form names and value limit data
* [http://www.php.net/manual/en/language.types.array.php array ] $limits<br/>An array with keys form names and value limit data
* [http://www.php.net/manual/en/language.types.array.php array] $orders<br/>An array with keys form names and values array of field orders for that form.  If the form name has no orders, we use default
* [http://www.php.net/manual/en/language.types.array.php array ] $orders<br/>An array with keys form names and values array of field orders for that form.  If the form name has no orders, we use default
**Default Value: array()
**Default Value: array()
*$display_first  
*$display_first  
**Default Value: true  
**Default Value: true  
* [http://www.php.net/manual/en/language.types.string.php string] $major_separator<br/>The seperator between the start display value and the extended display values.  If null, then the title is an array of values
* [http://www.php.net/manual/en/language.types.string.php string ] $major_separator<br/>The seperator between the start display value and the extended display values.  If null, then the title is an array of values
**Default Value: ' - '
**Default Value: ' - '
* [http://www.php.net/manual/en/language.types.string.php string] $minor_separator<br/>The sepeartor between the extended display values
* [http://www.php.net/manual/en/language.types.string.php string ] $minor_separator<br/>The sepeartor between the extended display values
**Default Value: ' '
**Default Value: ' '
===flattenDataTree()===
===flattenDataTree()===
Line 102: Line 103:
@param integer $code The code of the entry to lookup.
@param integer $code The code of the entry to lookup.
*Signature: static final protected function getCache($table_name,$id)
*Signature: static final protected function getCache($table_name,$id)
*Returns: [http://www.php.net/manual/en/language.types.string.php string] The value of the cached code.
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] The value of the cached code.
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $table_name<br/>The name of the table in the database.
* [http://www.php.net/manual/en/language.types.string.php string ] $table_name<br/>The name of the table in the database.
*$id  
*$id  
===getDisplayFields()===
===getDisplayFields()===
Returns a list of fields used for displaying this list.
Returns a list of fields used for displaying this list.
*Signature: static public function getDisplayFields($form_name)
*Signature: static public function getDisplayFields($form_name)
*Returns: [http://www.php.net/manual/en/language.types.array.php array]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
Parameters:
Parameters:
* [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_name
===getExtendedDisplay()===
===getExtendedDisplay()===
get an exended display for a field value
get an exended display for a field value
Line 118: Line 119:
If a "$form(+$link_field)" is surrounded by brackets [ ] , it is not displayed.
If a "$form(+$link_field)" is surrounded by brackets [ ] , it is not displayed.
*Signature: static public function getExtendedDisplay($fields,$start_value,$major_separator,$minor_separator)
*Signature: static public function getExtendedDisplay($fields,$start_value,$major_separator,$minor_separator)
*Returns: [http://www.php.net/manual/en/language.types.string.php string] or array
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] or array
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.array.php array] $fields<br/>An ordered array E.g array('village+county','county','district,'region+country','country').
* [http://www.php.net/manual/en/language.types.array.php array ] $fields<br/>An ordered array E.g array('village+county','county','district,'region+country','country').
* [http://www.php.net/manual/en/language.types.string.php string] $start_value<br/>E.g. "village|10"
* [http://www.php.net/manual/en/language.types.string.php string ] $start_value<br/>E.g. "village|10"
* [http://www.php.net/manual/en/language.types.string.php string] $major_separator<br/>The seperator between the start display value and the extended display values.  If null, we return an array.
* [http://www.php.net/manual/en/language.types.string.php string ] $major_separator<br/>The seperator between the start display value and the extended display values.  If null, we return an array.
**Default Value: ' - '
**Default Value: ' - '
* [http://www.php.net/manual/en/language.types.string.php string] $minor_separator<br/>The sepeartor between the extended display values
* [http://www.php.net/manual/en/language.types.string.php string ] $minor_separator<br/>The sepeartor between the extended display values
**Default Value: ' '
**Default Value: ' '
===getHTMLTemplate()===
===getHTMLTemplate()===
Return the HTML file name for the form template for this form.
Return the HTML file name for the form template for this form.
*Signature: public function getHTMLTemplate()
*Signature: public function getHTMLTemplate()
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getListType()===
===getListType()===
Return the list edit type for this list.
Return the list edit type for this list.
Line 137: Line 138:
linked list object for the object.
linked list object for the object.
*Signature: public function getListType()
*Signature: public function getListType()
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
===getSortFields()===
===getSortFields()===
Returns a list of fields used for sorting this list.
Returns a list of fields used for sorting this list.
*Signature: static public function getSortFields($form_name)
*Signature: static public function getSortFields($form_name)
*Returns: [http://www.php.net/manual/en/language.types.array.php array]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
Parameters:
Parameters:
* [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_name
===isCached()===
===isCached()===
Checks to see if the {@link id} number is cached.
Checks to see if the {@link id} number is cached.
Line 150: Line 151:
@param integer $code The code of the entry to lookup.
@param integer $code The code of the entry to lookup.
*Signature: static final protected function isCached($table_name,$id)
*Signature: static final protected function isCached($table_name,$id)
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $table_name<br/>The name of the table in the database.
* [http://www.php.net/manual/en/language.types.string.php string ] $table_name<br/>The name of the table in the database.
*$id  
*$id  
===listOptions()===
===listOptions()===
Line 161: Line 162:
are under country|10.  In this case we display the extended version of the option
are under country|10.  In this case we display the extended version of the option
*Signature: static public function listOptions($form_name,$opt_field,$opt_value,$sub_fields,$selectable_forms)
*Signature: static public function listOptions($form_name,$opt_field,$opt_value,$sub_fields,$selectable_forms)
*Returns: [http://www.php.net/manual/en/language.types.array.php array]
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $form_name<br/>The form being listed.  This needs to be a subclass of I2CE_List
* [http://www.php.net/manual/en/language.types.string.php string ] $form_name<br/>The form being listed.  This needs to be a subclass of I2CE_List
* [http://www.php.net/manual/en/language.types.string.php string] $opt_field<br/>An optional field to further limit the list of choices
* [http://www.php.net/manual/en/language.types.string.php string ] $opt_field<br/>An optional field to further limit the list of choices
**Default Value: ""
**Default Value: ""
* integer $opt_value<br/>If the $opt_field is used then this is the value to limit it by.
* integer $opt_value<br/>If the $opt_field is used then this is the value to limit it by.
**Default Value: '|'
**Default Value: '|'
* [http://www.php.net/manual/en/language.types.array.php array] $sub_fields<br/>of string.  If $op_value is is set, it is an array of  linked ($form+)$field's to
* [http://www.php.net/manual/en/language.types.array.php array ] $sub_fields<br/>of string.  If $op_value is is set, it is an array of  linked ($form+)$field's to
**Default Value: array()  
**Default Value: array()  
*$selectable_forms  
*$selectable_forms  
Line 178: Line 179:
the object based on the code and saves it in the {@link cache} and returns it.
the object based on the code and saves it in the {@link cache} and returns it.
*Signature: static public function lookup($id,$form_name)
*Signature: static public function lookup($id,$form_name)
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
Parameters:
Parameters:
* integer $id<br/>The code of the entry to lookup.
* integer $id<br/>The code of the entry to lookup.
* [http://www.php.net/manual/en/language.types.string.php string] $form_name<br/>The name of the form in the database.
* [http://www.php.net/manual/en/language.types.string.php string ] $form_name<br/>The name of the form in the database.
===monsterMash()===
===monsterMash()===
Gets the id's for a form that live at
Gets the id's for a form that live at
Line 193: Line 194:
*Signature: static public function monsterMash($form_name,$opt_field,$opt_formid,$sub_fields,$display_fields,$use_display_value)
*Signature: static public function monsterMash($form_name,$opt_field,$opt_formid,$sub_fields,$display_fields,$use_display_value)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $form_name<br/>Example person
* [http://www.php.net/manual/en/language.types.string.php string ] $form_name<br/>Example person
* stirng $opt_field<br/>The field we are limiting $form_name on.  Example 'residence'
* stirng $opt_field<br/>The field we are limiting $form_name on.  Example 'residence'
* stirng $opt_formid<br/>The form|id and we wish to look that $opt_field takes values in
* stirng $opt_formid<br/>The form|id and we wish to look that $opt_field takes values in
* artary $sub_fields<br/>Example  array(county+district,district+region,[region]) If a non-empty array it are the sub-fields path we wish to add to the results.
* artary $sub_fields<br/>Example  array(county+district,district+region,[region]) If a non-empty array it are the sub-fields path we wish to add to the results.
* [http://www.php.net/manual/en/language.types.array.php array] $display_fields<br/>The fields which we return the values of.  Defaults to an empty array in which case the value of $options is the
* [http://www.php.net/manual/en/language.types.array.php array ] $display_fields<br/>The fields which we return the values of.  Defaults to an empty array in which case the value of $options is the
**Default Value: array()
**Default Value: array()
*$use_display_value  
*$use_display_value  
Line 206: Line 207:
This will return the same value as lookup() but from the current object instead of from the database.
This will return the same value as lookup() but from the current object instead of from the database.
*Signature: public function name($delim)
*Signature: public function name($delim)
*Returns: [http://www.php.net/manual/en/language.types.string.php string]
*Returns: [http://www.php.net/manual/en/language.types.string.php string ]
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $delim<br/>the delimiter between fields.
* [http://www.php.net/manual/en/language.types.string.php string ] $delim<br/>the delimiter between fields.
**Default Value: ' - '  
**Default Value: ' - '  
===setDisplayData()===
===setDisplayData()===
Line 224: Line 225:
Parameters:
Parameters:
*$field_path  
*$field_path  
* [http://www.php.net/manual/en/language.types.string.php string] $formid<br/>string of the form "$form|$id".  the starting value.  $form should be one of formX above (e.g. the dbvalue of a map field)
* [http://www.php.net/manual/en/language.types.string.php string ] $formid<br/>string of the form "$form|$id".  the starting value.  $form should be one of formX above (e.g. the dbvalue of a map field)
==Inherited Variables==
==Inherited Variables==
===$children===
===$children===

Revision as of 21:25, 16 October 2009

This article desrcibes the1 class I2CE_List.

It is contained in the module Lists in the package I2CE

The class is defined in the file: modules/Forms/modules/Lists/lib/I2CE_List.php

Base object for dealing with lists of data. This is an abstract object with base code for many of the I2CE_Form interface methods. It is used for many of the list database objects such as {@link AcademicLevel} and {@link District}. It assumes all lists have a code field and by default a description field but this can be overwritten by certain objects like {@link Cadre}. @abstract

  • Author: Luke Duncan <lduncan@intrahealth.org>
  • Since: v1.0.0

Constants

I2CE_List::MAIN_FIELD

The main field name used for display a description of a record. Defined as: "name"

I2CE_List::SEC_FIELD

The secondary field name used for displaying a description of a record in combination with the MAIN_FIELD. Defined as: null

I2CE_List::SORT_FIELD

The sort field name to be used for sorting the display list. This can't be used with the SEC_FIELD option for display. Defined as: null

Variables

$cache

An array to cache lookup entries

Any lookups done to the database will be cached in this static array so additional lookups using the same id won't have to access the database. @static

  • Type: static protected y $cache

Methods

_flattenDataTree()

  • Signature: static protected function _flattenDataTree($data,$list)

Parameters:

  • $data
  • &$list

_monsterMash()

Gets the id's for a form that live at the displayed fields for $form_name that corresponds to that value. If $use_display_fields is false, then we return an array of the display fields @param string $use_display value. Defaults to true in which case the displayed fields are returned based on the display value. If false, then the displa @param string $use_display value. Defaults to true in which case the displayed fields are returned based on the display value. If false, then the displa

  • Signature: static protected function _monsterMash($options,$form_name,$opt_field,$opt_form,$opt_id,$sub_fields,$sub_val,$display_fields,$use_display_value)

Parameters:

  • array &$options
    Where the id's are saved. Array with keys the ids of $form_name. For values, if $use_dislpay_value is true, then
  • string $form_name
  • stirng $opt_field
    The field we are limiting $form_name on.
  • stirng $opt_form
    The form we wish to look that $opt_field takes values in
  • string $opt_id
    The id wish to look that $opt_field takes values. e.g. we are looking for all instances of $form_name where $opt_field is $opt_form|$opt_id
  • artary $sub_fields
    Example array(county+district,district+region,[region])
  • string $sub_val
    Defaults to . If use_display_value is set, a string we prepend to the displayed fields for the id
    • Default Value:
  • array $display_fields
    The fields which we use to populate $options with. Defaults to an empty array in which case the value of $options is the display fields registered for this form .
    • Default Value: array()
  • $use_display_value
    • Default Value: true

addCache()

Adds the {@link id} number to the {@link cache}.

@param integer $code The code of the entry to add.

  • Signature: static final protected function addCache($table_name,$id,$value)

Parameters:

  • string $table_name
    The name of the table in the database.
  • $id
  • string $value
    The value to add to the cache

componentizeQuery()

returns the posible componentization of a form|id @parm string $component The component we possibly wish to componentize at.

  • Signature: static public function componentizeQuery($qry,$forms,$component)
  • Returns: string. They query need to turn $qry into one componentized to $component.

Parameters:

  • string $qry
    the query need to get the form|id
  • array $forms
    an array of string which are componentized
  • $component

createDataTree()

Create a data tree of the selectable forms. Deisgned to be fed into tree select it is an "bottom up" array of string where strings are of the form "$form" or "$form+$link_field". In the case of the former type, then $link_field is assumed to be the next form. So for example, "county" has link field "district". If a "$form(+$link_field)" is surrounded by brackets [ ] , it is not displayed. ordering for that form based on its displayed firelds

  • Signature: static public function createDataTree($fields,$forms,$limits,$orders,$display_first,$major_separator,$minor_separator)

Parameters:

  • array $fields
    an ordered array E.g array('village+county','county','district,'region+country','country').
  • array $forms
    An unorderd array of form names whose values we allow to be selected
  • array $limits
    An array with keys form names and value limit data
  • array $orders
    An array with keys form names and values array of field orders for that form. If the form name has no orders, we use default
    • Default Value: array()
  • $display_first
    • Default Value: true
  • string $major_separator
    The seperator between the start display value and the extended display values. If null, then the title is an array of values
    • Default Value: ' - '
  • string $minor_separator
    The sepeartor between the extended display values
    • Default Value: ' '

flattenDataTree()

  • Signature: static public function flattenDataTree($data)

Parameters:

  • $data

getCache()

Return the {@link cache cached} entry for the {@link id} number.

@param integer $code The code of the entry to lookup.

  • Signature: static final protected function getCache($table_name,$id)
  • Returns: string The value of the cached code.

Parameters:

  • string $table_name
    The name of the table in the database.
  • $id

getDisplayFields()

Returns a list of fields used for displaying this list.

  • Signature: static public function getDisplayFields($form_name)
  • Returns: array

Parameters:

getExtendedDisplay()

get an exended display for a field value it is an "bottom up" array of string where strings are of the form "$form" or "$form+$link_field". In the case of the former type, then $link_field is assumed to be the next form. So for example, "county" has link field "district". If a "$form(+$link_field)" is surrounded by brackets [ ] , it is not displayed.

  • Signature: static public function getExtendedDisplay($fields,$start_value,$major_separator,$minor_separator)
  • Returns: string or array

Parameters:

  • array $fields
    An ordered array E.g array('village+county','county','district,'region+country','country').
  • string $start_value
    E.g. "village|10"
  • string $major_separator
    The seperator between the start display value and the extended display values. If null, we return an array.
    • Default Value: ' - '
  • string $minor_separator
    The sepeartor between the extended display values
    • Default Value: ' '

getHTMLTemplate()

Return the HTML file name for the form template for this form.

  • Signature: public function getHTMLTemplate()
  • Returns: string

getListType()

Return the list edit type for this list.

The possible return values are "list," "dual," or "select." Select will display a drop down of all choices and list and dual will list them all in a table. Dual includes the linked list object for the object.

  • Signature: public function getListType()
  • Returns: string

getSortFields()

Returns a list of fields used for sorting this list.

  • Signature: static public function getSortFields($form_name)
  • Returns: array

Parameters:

isCached()

Checks to see if the {@link id} number is cached.

Checks the {@link cache} to see if {@link code} has been cached or not. @param integer $code The code of the entry to lookup.

  • Signature: static final protected function isCached($table_name,$id)
  • Returns: boolean

Parameters:

  • string $table_name
    The name of the table in the database.
  • $id

listOptions()

Return the list of options for this list as an array.

include results under the optional value. e.g. if $opt_value was 'country|10' and $sub_fields was array(county+district,district+region,[region],country) we would display all counties and district who are under country|10. In this case we display the extended version of the option

  • Signature: static public function listOptions($form_name,$opt_field,$opt_value,$sub_fields,$selectable_forms)
  • Returns: array

Parameters:

  • string $form_name
    The form being listed. This needs to be a subclass of I2CE_List
  • string $opt_field
    An optional field to further limit the list of choices
    • Default Value: ""
  • integer $opt_value
    If the $opt_field is used then this is the value to limit it by.
    • Default Value: '|'
  • array $sub_fields
    of string. If $op_value is is set, it is an array of linked ($form+)$field's to
    • Default Value: array()
  • $selectable_forms
    • Default Value: array()

lookup()

Looks up the description of the item based on the code.

This is the default method that most implementations of {@link lookup()} use. It finds the description of the object based on the code and saves it in the {@link cache} and returns it.

  • Signature: static public function lookup($id,$form_name)
  • Returns: string

Parameters:

  • integer $id
    The code of the entry to lookup.
  • string $form_name
    The name of the form in the database.

monsterMash()

Gets the id's for a form that live at In the example, if $opt_form|$opt_id = country|10 and $link_field = country, then we add in person where residence = country|10, then those person where residence is an region where region+country = country|10. Then we add in those person id's where residence is any distrinct whose region is a region with region+country = country|10. Then we add in those person id's where residence is an county whose district has rgion field a region whose country field is country|10. display fields registered for this form . @param string $use_display value. Defaults to true in which case the displayed fields are returned based on the display value. If false, then the displa @ returns array. . Array with keys the ids of $form_name. For values, if $use_dislpay_value is true, then

  • Signature: static public function monsterMash($form_name,$opt_field,$opt_formid,$sub_fields,$display_fields,$use_display_value)

Parameters:

  • string $form_name
    Example person
  • stirng $opt_field
    The field we are limiting $form_name on. Example 'residence'
  • stirng $opt_formid
    The form|id and we wish to look that $opt_field takes values in
  • artary $sub_fields
    Example array(county+district,district+region,[region]) If a non-empty array it are the sub-fields path we wish to add to the results.
  • array $display_fields
    The fields which we return the values of. Defaults to an empty array in which case the value of $options is the
    • Default Value: array()
  • $use_display_value
    • Default Value: true

name()

Return the display name for this list object.

This will return the same value as lookup() but from the current object instead of from the database.

  • Signature: public function name($delim)
  • Returns: string

Parameters:

  • string $delim
    the delimiter between fields.
    • Default Value: ' - '

setDisplayData()

Sets the field values to be displayed in the HTML template.

  • Signature: public function setDisplayData($template)

Parameters:

walkupFieldPath()

Walk up a form/linked field path until. Return the id of the top form. $param mixed. Either an array of string or a colon-sepearted string. (imploded) values is a string of the form: form1(+field1):...:formM(+fieldM):..:fieldN there needs to be at least one colon/array needs to be at least two in length

  • Signature: static public function walkupFieldPath($field_path,$formid)
  • Returns: mixed. False on failure, string of the form "$form|$id" on success

Parameters:

  • $field_path
  • string $formid
    string of the form "$form|$id". the starting value. $form should be one of formX above (e.g. the dbvalue of a map field)

Inherited Variables

$children

Theis public variable is inherited from I2CE_Form->$children

$fields

Theis protected variable is inherited from I2CE_Form->$fields

$parent

Theis protected variable is inherited from I2CE_Form->$parent

$id

Theis protected variable is inherited from I2CE_Form->$id

$attributes

Theis protected variable is inherited from I2CE_Form->$attributes

$parent_forms

Theis protected variable is inherited from I2CE_Form->$parent_forms

Inherited Fuzzy Methods

isNumeric()

This method is inherited from I2CE_Form->isNumeric()

getLimitStyles()

This method is inherited from I2CE_Form->getLimitStyles()

checkLimit()

This method is inherited from I2CE_Form->checkLimit()

checkWhereClause()

This method is inherited from I2CE_Form->checkWhereClause()

createCheckFunction()

This method is inherited from I2CE_Form->createCheckFunction()

createCheckLimitString()

This method is inherited from I2CE_Form->createCheckLimitString()

generateLimit()

This method is inherited from I2CE_Form->generateLimit()

generateWhereClause()

This method is inherited from I2CE_Form->generateWhereClause()

processLimit()

This method is inherited from I2CE_Form->processLimit()

getDisplayedExistingLimit()

This method is inherited from I2CE_Form->getDisplayedExistingLimit()

isComponentized()

This method is inherited from I2CE_Form->isComponentized()

addChild()

This method is inherited from I2CE_Form->addChild()

getChildIds()

This method is inherited from I2CE_Form->getChildIds()

getStorage()

This method is inherited from I2CE_Form->getStorage()

isWritable()

This method is inherited from I2CE_Form->isWritable()

populate()

This method is inherited from I2CE_Form->populate()

populateChild()

This method is inherited from I2CE_Form->populateChild()

populateChildren()

This method is inherited from I2CE_Form->populateChildren()

populateFirst()

This method is inherited from I2CE_Form->populateFirst()

populateHistory()

This method is inherited from I2CE_Form->populateHistory()

populateLast()

This method is inherited from I2CE_Form->populateLast()

delete()

This method is inherited from I2CE_Form->delete()

save()

This method is inherited from I2CE_Form->save()

setChangeType()

This method is inherited from I2CE_Form->setChangeType()

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()