Class: I2CE FormStorage Flat
This article desrcibes the class I2CE_FormStorage_Flat.
- Extends the class: I2CE_FormStorage_DB.
- Location: Part of the module forms-storage-flat in the package I2CE
- Source: Defined in the file modules/Forms/modules/FormStorage/modules/FormStorageFlat/lib/I2CE_FormStorage_flat.php
- Author: Carl Leitner <litlfred@ibiblio.org>
- Since: v3.2.0
@filesource Class I2CE_FormStorage_Flat
Variables
$storage_options_cache
of I2CE_MagicDataNodes. The keys are the names of forms which have flat storage.
- Type: protected y $storage_options_cache
$formObjs
. Keys are form names, values are instanceof I2CE_Form
- Type: protected y $formObjs
Methods
__construct()
The constructor for the storage mechanism
- Signature: public function __construct($name,$global_options)
- Parameters:
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)
- Parameters:
- string $form
- Returns: I2CE_Form
or false on failure.
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 @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"
- Signature: public function getRequiredFieldsQuery($form,$fields,$id,$parent,$field_reference_callback,$mod_time)
- 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 If it is scalar and non-boolean, it is consider to be the ID of the parent, and then we get all forms with parent the given id.- Default Value: false
- $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 time greater than or equal to $mod_time. If the form storage has no way of tracking modifucation time, all entries are listed.- Default Value: -1
- Returns: string
the query or false on failed.
getStorageOptions()
Checks that the storage mechansim for the given form is 'flat' and has storage options.
- Signature: protected function getStorageOptions($form)
- Parameters:
- string $form
- Returns: mixed
I2CE_MagicDataNode of flat storage options on success, false on failure.
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()