You are here

public function HydratorListener::attach in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-hydrator/src/Aggregate/HydratorListener.php \Zend\Hydrator\Aggregate\HydratorListener::attach()

File

vendor/zendframework/zend-hydrator/src/Aggregate/HydratorListener.php, line 39

Class

HydratorListener
Aggregate listener wrapping around a hydrator.

Namespace

Zend\Hydrator\Aggregate

Code

public function attach(EventManagerInterface $events, $priority = 1) {
  $this->listeners[] = $events
    ->attach(HydrateEvent::EVENT_HYDRATE, [
    $this,
    'onHydrate',
  ], $priority);
  $this->listeners[] = $events
    ->attach(ExtractEvent::EVENT_EXTRACT, [
    $this,
    'onExtract',
  ], $priority);
}