Class: I2CE FormStorage multi flat: Difference between revisions

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


Line 32: Line 33:
*Signature: public function __construct($name,$global_options)
*Signature: public function __construct($name,$global_options)
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $name
* [http://www.php.net/manual/en/language.types.string.php string ] $name
* [http://www.php.net/manual/en/language.types.array.php array] $global_options<br/>Default to empty array. The array of options that are
* [http://www.php.net/manual/en/language.types.array.php array ] $global_options<br/>Default to empty array. The array of options that are
**Default Value: array()
**Default Value: array()
===fieldIsColumn()===
===fieldIsColumn()===
Line 48: Line 49:
*Returns: [[Class: I2CE_Form | I2CE_Form]] or false on failure.
*Returns: [[Class: I2CE_Form | I2CE_Form]] or false on failure.
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $form
* [http://www.php.net/manual/en/language.types.string.php string ] $form
===getRequiredFieldsQuery()===
===getRequiredFieldsQuery()===
Construct a query (to be used as a sub-select) to view the fields of the given form.  It always will return the id of the form as well
Construct a query (to be used as a sub-select) to view the fields of the given form.  It always will return the id of the form as well
Line 57: Line 58:
time greater than or equal to $mod_time.  If the form storage has no way of tracking modifucation time, all entries are listed.
time greater than or equal to $mod_time.  If the form storage has no way of tracking modifucation time, all entries are listed.
*Signature: public function getRequiredFieldsQuery($form,$fields,$id,$parent,$field_reference_callback,$mod_time)
*Signature: public function getRequiredFieldsQuery($form,$fields,$id,$parent,$field_reference_callback,$mod_time)
*Returns: [http://www.php.net/manual/en/language.types.string.php string] the query or false on failed.
*Returns: [http://www.php.net/manual/en/language.types.string.php string ] the query or false on failed.
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $form
* [http://www.php.net/manual/en/language.types.string.php string ] $form
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $fields<br/>Either a string, the field, or an array of string, the fields.
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $fields<br/>Either a string, the field, or an array of string, the fields.
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $id<br/>Defaults to null.  If non-null it is the id that we wish to limit to.
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $id<br/>Defaults to null.  If non-null it is the id that we wish to limit to.
**Default Value: null
**Default Value: null
* [http://www.php.net/manual/en/language.types.boolean.php boolean] $parent<br/>Defaults to false.  If true, we include the parent id as a referenced field
* [http://www.php.net/manual/en/language.types.boolean.php boolean ] $parent<br/>Defaults to false.  If true, we include the parent id as a referenced field
**Default Value: false
**Default Value: false
*$field_reference_callback  
*$field_reference_callback  
Line 72: Line 73:
Checks that the storage mechansim for the given form is 'multi_flat' and has storage options.
Checks that the storage mechansim for the given form is 'multi_flat' and has storage options.
*Signature: protected function getStorageOptions($form)
*Signature: protected function getStorageOptions($form)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] I2CE_MagicDataNode of flat storage options on success, false on failure.
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] I2CE_MagicDataNode of flat storage options on success, false on failure.
Parameters:
Parameters:
* [http://www.php.net/manual/en/language.types.string.php string] $form
* [http://www.php.net/manual/en/language.types.string.php string ] $form
===isWritable()===
===isWritable()===
Checks to see if this storage mechansim is writable
Checks to see if this storage mechansim is writable

Revision as of 21:26, 16 October 2009

This article desrcibes the class I2CE_FormStorage_multi_flat.

It is contained in the module forms-storage-multiflat in the package I2CE

The class is defined in the file: modules/Forms/modules/FormStorage/modules/FormStorageMultiFlat/lib/I2CE_FormStorage_multi_flat.php

@subpackage core @filesource Class I2CE_FormStorage_multi_flat

  • Author: Carl Leitner <litlfred@ibiblio.org>
  • Since: v4.0.1

Variables

$storage_options_cache

of I2CE_MagicDataNodes. The keys are the names of forms which have flat storage.

  • Type: protected y $storage_options_cache

$databases

sting. Keys are componentities and values are the assoicated database

  • Type: protected y $databases

$componentized_forms

componentized_forms. The array of componentized forms

  • Type: protected y $componentized_forms

$formObjs

. Keys are form names, values are instanceof I2CE_Form

  • Type: protected y $formObjs

Methods

__construct()

The constructor for the storage mechanism the same across all all forms which share a commone storage mechanisms

  • Signature: public function __construct($name,$global_options)

Parameters:

  • string $name
  • array $global_options
    Default to empty array. The array of options that are
    • Default Value: array()

fieldIsColumn()

  • Signature: protected function fieldIsColumn($data)

Parameters:

  • $data

getFieldData()

  • Signature: protected function getFieldData($data)

Parameters:

  • $data

getFormObj()

Get a (cached) form object for the given form

  • Signature: protected function getFormObj($form)
  • Returns: I2CE_Form or false on failure.

Parameters:

getRequiredFieldsQuery()

Construct a query (to be used as a sub-select) to view the fields of the given form. It always will return the id of the form as well 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. @param callback $field_refernece_callback. A callback function whose first arguement is the form, the second arguements is the field and which returns the way the field value should be references as a field. If the callback is null (the default) then the reference used is "$form+$field" time greater than or equal to $mod_time. If the form storage has no way of tracking modifucation time, all entries are listed.

  • Signature: public function getRequiredFieldsQuery($form,$fields,$id,$parent,$field_reference_callback,$mod_time)
  • Returns: string the query or false on failed.

Parameters:

  • string $form
  • mixed $fields
    Either a string, the field, or an array of string, the fields.
  • mixed $id
    Defaults to null. If non-null it is the id that we wish to limit to.
    • Default Value: null
  • boolean $parent
    Defaults to false. If true, we include the parent id as a referenced field
    • Default Value: false
  • $field_reference_callback
    • Default Value: null
  • 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
    • Default Value: -1

getStorageOptions()

Checks that the storage mechansim for the given form is 'multi_flat' and has storage options.

  • Signature: protected function getStorageOptions($form)
  • Returns: mixed I2CE_MagicDataNode of flat storage options on success, false on failure.

Parameters:

isWritable()

Checks to see if this storage mechansim is writable

  • Signature: public function isWritable()
  • Returns: boolean. false

Inherited Variables

$db

Theis protected variable is inherited from I2CE_FormStorage_DB->$db

$name

Theis protected variable is inherited from I2CE_FormStorage_Mechanism->$name

$global_options

Theis protected variable is inherited from I2CE_FormStorage_Mechanism->$global_options

$ordering

Theis protected variable is inherited from I2CE_FormStorage_Mechanism->$ordering

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()