Class: I2CE FormFactory (4.0.3)
This article describes the class I2CE_FormFactory .
- Extends the class: I2CE_Fuzzy.
- Location: Part of the module forms in the package I2CE 4.0.3-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.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 34
- Type: static private I2CE_FormFactory $instance
$classes
The classes that have been registered with the factory.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 38
- Type: private array $classes
Methods
__construct()
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 52
- Signature: public function __construct()
callStatic()
Call a static function in the form's class object.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 164
- 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 125
- Signature: public function createForm($formId)
- Parameters:
- string $formId
The name of the form possible with an id
- string $formId
- Returns: I2CE_Form
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 63
- Signature: public function exists($form)
- Parameters:
- string $form
The name of the form.
- string $form
- Returns: boolean
getClassHierarchy()
Get the class hierarchy associated to a class.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 84
- 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 112
- 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 252
- Signature: public function getConst($form,$var)
- Parameters:
getFieldNames()
Get the fields for a given form via what is stored in magic data. @param mixed $restict. Defaults to null which means there are no restrictions. Otherwise it should be an array consisting of any numbder of the following keys 'in_db', 'required', and 'unique' the values associated to each key should be true or false. We then only return fields who match the given value
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 201
- Signature: public function getFieldNames($form,$restrictions)
- Parameters:
- string $form
the short name of a form - $restrictions
- Default Value: array()
- string $form
- Returns: associative
array of string. key is the field the value is the form class
getForms()
get the available forms.
- Defined in i2ce/modules/Forms/lib/I2CE_FormFactory.php on line 71
- Signature: public function getForms()
- 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 183
- 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 43
- Signature: static public function instance()
Inherited Methods
_hasMethod()
This public method is inherited from I2CE_Fuzzy->_hasMethod()
Inherited Fuzzy Methods
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()
Fuzzy Methods
getRecords()
This method is implemented by I2CE_FormStorage->getRecords()