Class: I2CE FormFactory (4.0.6)
This article describes the class I2CE_FormFactory .
- Extends the class: I2CE_FieldContainer_Factory.
- Location: Part of the module forms in the package I2CE 4.0.6-release
- Source: Defined in the file modules/Forms/lib/I2CE_FormFactory.php on line 30
- Author: Luke Duncan <lduncan@intrahealth.org>
- Since: v1.0.0
This factory is used to create instances of I2CE_Form objects from the form name.
Variables
$instance
The single instance of this class. //maybe not needed when updating to php 5.3
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 44
- Type: static protected I2CE_FormFactory $instance
$classes
The classes that have been registered with the factory.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 60
- Type: protected array $classes
Methods
__construct()
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 63
- Signature: public function __construct()
_createContainer()
Worker method to create an instance of an I2CE_Form from the factory.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 243
- Signature: protected function _createContainer($factory,$form,$id)
- Parameters:
- I2CE_FieldContainer_Factory $factory
- string $form
The form of the field container - string $id
The id of the field container. Defaults to null- Default Value: '0'
- Returns: I2CE_FieldContainer
or null on failure
_getFieldData()
Get data needed to create all the fields in this field container
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 148
- Signature: protected function _getFieldData($name)
- Parameters:
- $name
- Returns: array.
_loadMetaAttributes()
Returns the array of attributes for this container
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 195
- Signature: protected function _loadMetaAttributes($name)
- Parameters:
- string $name
- Returns: array
callStatic()
Call a static function in the form's class object.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 270
- Signature: public function callStatic($form,$func,$args)
- Parameters:
createForm()
Return an instance of a I2CE_Form from the factory.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 231
- Signature: public function createForm($nameId,$no_cache)
- Parameters:
- mixed $nameId
The a string which is either the name of the field container, the name and id in the form of "$name|$id" or an array with two elements, the first is a name and the second is an id - boolean $no_cache
Defaults to false. If true then we don't check the cache when the id is non-zero- Default Value: false
- mixed $nameId
- Returns: I2CE_From
or null on failure
exists()
Checks to see if the given form has been registered.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 74
- Signature: public function exists($form)
- Parameters:
- string $form
The name of the form.
- string $form
- Returns: boolean
getAttributeData()
Recursive method to rraverse the class hierarchy to get the meta data for the form magic data @param array &$data array
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 208
- Signature: protected function getAttributeData($class,$attr)
- Parameters:
- string $class
the form class - &$attr
- string $class
getClassHierarchy()
Get the class hierarchy associated to a class.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 104
- Signature: public function getClassHierarchy($form)
- Parameters:
- $form
- Returns: array
The keys of the array range from 0 to N. The value of key 0 is the class associated to the form. The last key is has value 'I2CE_Form'. Returns null in error.
getClassName()
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 132
- Signature: public function getClassName($form)
- Parameters:
- $form
getConst()
Shortcut to retrieving a constant value from a form's class object.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 305
- Signature: public function getConst($form,$var)
- Parameters:
getContainerType()
Return type of container this factory makes
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 37
- Signature: public function getContainerType()
- Returns: string
getFormFieldsData()
Recursive method to rraverse the class hierarchy to get the field data from magic data
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 162
- Signature: protected function getFormFieldsData($class,$data)
- Parameters:
getForms()
get the available forms.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 91
- Signature: public function getForms()
- Returns: array
with values the form name
getNames()
get the available forms.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 82
- Signature: public function getNames()
- Returns: array
with values the form name
getStatic()
Return a static variable from the form's class object.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 289
- Signature: public function getStatic($form,$var,$const)
- Parameters:
instance()
Return the instance of this factory and create it if it doesn't exist.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 49
- Signature: static public function instance()
Inherited Methods
cleanup()
This public method is inherited from I2CE_FieldContainer_Factory->cleanup()
createContainer()
This public method is inherited from I2CE_FieldContainer_Factory->createContainer()
getFieldData()
This public method is inherited from I2CE_FieldContainer_Factory->getFieldData()
getFieldNames()
This public method is inherited from I2CE_FieldContainer_Factory->getFieldNames()
getMetaAttribute()
This public method is inherited from I2CE_FieldContainer_Factory->getMetaAttribute()
hasMetaAttribute()
This public method is inherited from I2CE_FieldContainer_Factory->hasMetaAttribute()
loadMetaAttributes()
This public method is inherited from I2CE_FieldContainer_Factory->loadMetaAttributes()
removeFromCache()
This public method is inherited from I2CE_FieldContainer_Factory->removeFromCache()
setMetaAttribute()
This public method is inherited from I2CE_FieldContainer_Factory->setMetaAttribute()
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Variables
$instance
Theis protected variable is inherited from I2CE_FieldContainer_Factory->$instance
$meta
Theis protected variable is inherited from I2CE_FieldContainer_Factory->$meta
$fieldData
Theis protected variable is inherited from I2CE_FieldContainer_Factory->$fieldData
$containerCache
Theis protected variable is inherited from I2CE_FieldContainer_Factory->$containerCache
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()
Fuzzy Methods
getRecords()
This method is implemented by I2CE_FormStorage->getRecords()