hydrators = $hydrators; } /** * {@inheritdoc} */ public function hydrate(array $data, $object) { return $this->getHydrator($object)->hydrate($data, $object); } /** * {@inheritdoc} */ public function extract($object) { return $this->getHydrator($object)->extract($object); } /** * Gets hydrator of an object * * @param object $object * @return HydratorInterface */ protected function getHydrator($object) { return $this->hydrators->get(get_class($object)); } }