Default listeners for form annotations

Defines and attaches a set of default listeners for form annotations (which are defined on object properties). These include:

  • Attributes
  • Flags
  • Hydrator
  • Object and Instance (the latter is preferred starting in 2.4)
  • InputFilter
  • Type
  • ValidationGroup

See the individual annotation classes for more details. The handlers registered work with the annotation values, as well as the form specification passed in the event object.

package Default
inherited_from \Zend\Form\Annotation\AbstractAnnotationsListener

 Methods

Attach listeners

attach(\Zend\EventManager\EventManagerInterface $events) : void

Parameters

$events

\Zend\EventManager\EventManagerInterface

Detach all previously attached listeners

detach(\Zend\EventManager\EventManagerInterface $events) 
Inherited
inherited_from \Zend\EventManager\ListenerAggregateInterface::detach()

Parameters

$events

Discover the fallback name via reflection

discoverFallbackName(\Zend\EventManager\EventInterface $e) : string
Inherited

Parameters

$e

\Zend\EventManager\EventInterface

Returns

string

Handle the Attributes annotation

handleAttributesAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the attributes key of the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

Handle the Flags annotation

handleFlagsAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the flags key of the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

Handle the Hydrator annotation

handleHydratorAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the hydrator class to use in the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

Handle the InputFilter annotation

handleInputFilterAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the input filter class to use in the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

Attempt to discover a name set via annotation

handleNameAnnotation(\Zend\EventManager\EventInterface $e) : false | string
Inherited

Parameters

$e

\Zend\EventManager\EventInterface

Returns

falsestring

Handle the Object and Instance annotations

handleObjectAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the object to bind to the form or fieldset

Parameters

$e

\Zend\EventManager\EventInterface

Handle the Options annotation

handleOptionsAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the options key of the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

Handle the Type annotation

handleTypeAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the form class to use in the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

Handle the ValidationGroup annotation

handleValidationGroupAnnotation(\Zend\EventManager\EventInterface $e) : void

Sets the validation group to use in the form specification.

Parameters

$e

\Zend\EventManager\EventInterface

 Properties

 

$listeners

$listeners : array<mixed,\Zend\Stdlib\CallbackHandler>

Default

array()