Class FormElementManagerV2Polyfill

Summary

Fully Qualified Name: Zend\Form\FormElementManager\FormElementManagerV2Polyfill
Extends: AbstractPluginManager

Description

zend-servicemanager v2-compatible plugin manager implementation for form elements.

Enforces that elements retrieved are instances of ElementInterface.

Methods

Name Description Defined By
__construct() Constructor FormElementManagerV2Polyfill
addAbstractFactory() Add an abstract factory for resolving services. ServiceManager
addDelegator() Add a delegator for a given service. ServiceManager
addInitializer() Overrides parent::addInitializer in order to ensure default initializers are in expected positions. FormElementManagerV2Polyfill
build() {@inheritDoc} ServiceManager
callElementInit() Call init() on any element that implements InitializableInterface FormElementManagerV2Polyfill
configure() Override configure() to validate service instances. AbstractPluginManager
get() {@inheritDoc} AbstractPluginManager
getAllowOverride() Retrieve the flag indicating immutability status. ServiceManager
getServiceLocator() Implemented for backwards compatibility with previous plugin managers only. ServiceManager
has() {@inheritDoc} ServiceManager
injectFactory() Inject the factory to any element that implements FormFactoryAwareInterface FormElementManagerV2Polyfill
mapLazyService() Create a lazy service mapping to a class. ServiceManager
setAlias() Add an alias. ServiceManager
setAllowOverride() Indicate whether or not the instance is immutable. ServiceManager
setFactory() Specify a factory for a given service name. ServiceManager
setInvokableClass() Override setInvokableClass FormElementManagerV2Polyfill
setService() Map a service. ServiceManager
setServiceLocator() Implemented for backwards compatibility only. AbstractPluginManager
setShared() Add a service sharing rule. ServiceManager
validate() {@inheritDoc} AbstractPluginManager
validatePlugin() Validate the plugin is of the expected type. FormElementManagerV2Polyfill

Method Details

__construct()

Constructor

Overrides parent constructor in order to add the initializer methods injectFactory() and callElementInit().

Parameter Name Type Description
$configOrContainerInstance null|\ConfigInterface|\ContainerInterface
$v3config array If
$configInstanceOrParentLocator

Returns:

addAbstractFactory()

Add an abstract factory for resolving services.

Parameter Name Type Description
$factory string|\Factory\AbstractFactoryInterface Service

Returns:

addDelegator()

Add a delegator for a given service.

Parameter Name Type Description
$name string Service
$factory string|callable|\Factory\DelegatorFactoryInterface Delegator factory

Returns:

addInitializer()

Overrides parent::addInitializer in order to ensure default initializers are in expected positions.

Always pushes injectFactory to top of initializer stack, and callElementInit to the bottom.

{@inheritDoc}

Parameter Name Type Description
$initializer
$topOfStack

Returns:

build()

{@inheritDoc}

Parameter Name Type Description
$name
$options

Returns:

callElementInit()

Call init() on any element that implements InitializableInterface

Parameter Name Type Description
$instance mixed Instance
$container \ContainerInterface

Returns:

configure()

Override configure() to validate service instances.

If an instance passed in the services configuration is invalid for the plugin manager, this method will raise an InvalidServiceException.

{@inheritDoc}

Parameter Name Type Description
$config

Returns:

get()

{@inheritDoc}

Parameter Name Type Description
$name string Service
$options null|array Options

Returns: mixed

getAllowOverride()

Retrieve the flag indicating immutability status.

Returns: bool

getServiceLocator()

Implemented for backwards compatibility with previous plugin managers only.

Returns the creation context.

Returns: \ContainerInterface

has()

{@inheritDoc}

Parameter Name Type Description
$name

Returns:

injectFactory()

Inject the factory to any element that implements FormFactoryAwareInterface

Parameter Name Type Description
$instance mixed Instance
$container \ContainerInterface Container

Returns:

mapLazyService()

Create a lazy service mapping to a class.

Parameter Name Type Description
$name string Service
$class null|string Class

Returns:

setAlias()

Add an alias.

Parameter Name Type Description
$alias string
$target string

Returns:

setAllowOverride()

Indicate whether or not the instance is immutable.

Parameter Name Type Description
$flag bool

Returns:

setFactory()

Specify a factory for a given service name.

Parameter Name Type Description
$name string Service
$factory string|callable|\Factory\FactoryInterface Factory

Returns:

setInvokableClass()

Override setInvokableClass

Overrides setInvokableClass to:

Parameter Name Type Description
$name string
$invokableClass string
$shared null|bool Ignored.

Returns: self

setService()

Map a service.

Parameter Name Type Description
$name string Service
$service array|object

Returns:

setServiceLocator()

Implemented for backwards compatibility only.

Returns the creation context.

Parameter Name Type Description
$container \ContainerInterface

Returns: void

setShared()

Add a service sharing rule.

Parameter Name Type Description
$name string Service
$flag bool Whether

Returns:

validate()

{@inheritDoc}

Parameter Name Type Description
$instance

Returns:

validatePlugin()

Validate the plugin is of the expected type.

Parameter Name Type Description
$plugin mixed

Returns:

Top