Class PrototypeClassFactory

Summary

Fully Qualified Name: Zend\Code\Generic\Prototype\PrototypeClassFactory

Description

This is a factory for classes which are identified by name.

All classes that this factory can supply need to be registered before (prototypes). This prototypes need to implement an interface which ensures every prototype has a name.

If the factory can not supply the class someone is asking for it tries to fallback on a generic default prototype, which would have need to be set before.

Methods

Name Description Defined By
__construct() PrototypeClassFactory
addPrototype() PrototypeClassFactory
getClonedPrototype() PrototypeClassFactory
hasPrototype() PrototypeClassFactory
setGenericPrototype() PrototypeClassFactory

Method Details

__construct()

Parameter Name Type Description
$prototypes \PrototypeInterface[]
$genericPrototype \PrototypeGenericInterface

Returns:

addPrototype()

Parameter Name Type Description
$prototype \PrototypeInterface

Returns:

getClonedPrototype()

Parameter Name Type Description
$prototypeName string

Returns: \PrototypeInterface

hasPrototype()

Parameter Name Type Description
$name string

Returns: bool

setGenericPrototype()

Parameter Name Type Description
$prototype \PrototypeGenericInterface

Returns:

Top