spunQ_FormFactory Class Reference

A factory object that creates forms. More...

Inheritance diagram for spunQ_FormFactory:

spunQ_DefaultFormFactory

List of all members.

Public Member Functions

 __construct ()
 Constructor.

Static Public Member Functions

static get ($type, array $params=array(), $recreate=false)
 Gets the form with given name.
static getByName ($name, $recreate=false)
 Gets the form with given name.

Protected Member Functions

 createByName ($name)
 Creates a form with given name.

Static Protected Attributes

static $instances = array()
 Factory instances.
static $allForms = array()
 Central storage for all forms that have been generated.


Detailed Description

A factory object that creates forms.

Definition at line 6 of file FormFactory.class.php.


Constructor & Destructor Documentation

spunQ_FormFactory::__construct (  ) 

Constructor.

Adds itself to the $instances array.

Definition at line 93 of file FormFactory.class.php.


Member Function Documentation

spunQ_FormFactory::createByName ( name  )  [abstract, protected]

Creates a form with given name.

If this factory is not able to create the form, it is expected to return NULL.

Parameters:
$name The name of the form to create.
Returns:
spunQ_Form Or NULL

Reimplemented in spunQ_DefaultFormFactory.

static spunQ_FormFactory::get ( type,
array $  params = array(),
recreate = false 
) [static]

Gets the form with given name.

WARNING: The provided forms are cached, successive calls to this function with the same name will yield the same object. Provide the $recreate parameter to change this behaviour.

Parameters:
$name The name of the form to retrieve.
$params Parameters to be passed to the form factory.
$recreate Forces bypassing of the cache, re-generating the form object using its form factory. Set this to true if one of the parameters to a form have changed somehow.
Returns:
spunQ.html.Form

Definition at line 35 of file FormFactory.class.php.

static spunQ_FormFactory::getByName ( name,
recreate = false 
) [static]

Gets the form with given name.

WARNING: The provided forms are cached, successive calls to this function with the same name will yield the same object. Provide the $recreate parameter to change this behaviour.

Parameters:
$name The name of the form to retrieve.
$recreate Forces bypassing of the cache, re-generating the form object using its form factory. Set this to true if one of the parameters to a form have changed somehow.
Returns:
spunQ.html.Form

Definition at line 73 of file FormFactory.class.php.


Member Data Documentation

spunQ_FormFactory::$allForms = array() [static, protected]

Central storage for all forms that have been generated.

The forms are mapped by their name.

Type:
map<string,spunQ.html.form>

Definition at line 21 of file FormFactory.class.php.

spunQ_FormFactory::$instances = array() [static, protected]

Factory instances.

There can be multiple form factories, each one will be requested to create the form with given name until one of them succeeeds.

Type:
array<spunQ_FormFactory>

Definition at line 14 of file FormFactory.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:40 2011 for spunQ3 by  doxygen 1.5.9