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
  • 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.

 Methods

Attach listeners

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

Implementors may add an optional $priority argument; the EventManager implementation will pass this to the aggregate.

Parameters

Detach all previously attached listeners

detach(\Zend\EventManager\EventManagerInterface $events) : void
Inherited

inherited_from \Zend\EventManager\AbstractListenerAggregate::detach()
inherited_from \Zend\Form\Annotation\AbstractAnnotationsListener::detach()

Parameters

Discover the fallback name via reflection

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

inherited_from \Zend\Form\Annotation\AbstractAnnotationsListener::discoverFallbackName()

Parameters

Returns

string

Handle the Attributes annotation

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

Sets the attributes key of the form specification.

Parameters

Handle the Flags annotation

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

Sets the flags key of the form specification.

Parameters

Handle the Hydrator annotation

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

Sets the hydrator class to use in the form specification.

Parameters

Handle the InputFilter annotation

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

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

Parameters

Attempt to discover a name set via annotation

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

inherited_from \Zend\Form\Annotation\AbstractAnnotationsListener::handleNameAnnotation()

Parameters

Returns

falsestring

Handle the Object annotation

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

Sets the object to bind to the form or fieldset

Parameters

Handle the Options annotation

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

Sets the options key of the form specification.

Parameters

Handle the Type annotation

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

Sets the form class to use in the form specification.

Parameters

Handle the ValidationGroup annotation

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

Sets the validation group to use in the form specification.

Parameters

 Properties

 

$listeners

$listeners : \Zend\Stdlib\CallbackHandler[]
Inherited

inherited_from \Zend\EventManager\AbstractListenerAggregate::$$listeners
inherited_from \Zend\Form\Annotation\AbstractAnnotationsListener::$$listeners