You are here

public function AggregateHydrator::add in Zircon Profile 8.0

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

Attaches the provided hydrator to the list of hydrators to be used while hydrating/extracting data

Parameters

HydratorInterface $hydrator:

int $priority:

File

vendor/zendframework/zend-hydrator/src/Aggregate/AggregateHydrator.php, line 35

Class

AggregateHydrator
Aggregate hydrator that composes multiple hydrators via events

Namespace

Zend\Hydrator\Aggregate

Code

public function add(HydratorInterface $hydrator, $priority = self::DEFAULT_PRIORITY) {
  $this
    ->getEventManager()
    ->attachAggregate(new HydratorListener($hydrator), $priority);
}