class DelegatingHydrator in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-hydrator/src/DelegatingHydrator.php \Zend\Hydrator\DelegatingHydrator
- 8 vendor/zendframework/zend-stdlib/src/Hydrator/DelegatingHydrator.php \Zend\Stdlib\Hydrator\DelegatingHydrator
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-hydrator/src/DelegatingHydrator.php \Zend\Hydrator\DelegatingHydrator
Hierarchy
- class \Zend\Hydrator\DelegatingHydrator implements HydratorInterface
Expanded class hierarchy of DelegatingHydrator
1 file declares its use of DelegatingHydrator
- DelegatingHydrator.php in vendor/
zendframework/ zend-stdlib/ src/ Hydrator/ DelegatingHydrator.php
File
- vendor/
zendframework/ zend-hydrator/ src/ DelegatingHydrator.php, line 14
Namespace
Zend\HydratorView source
class DelegatingHydrator implements HydratorInterface {
/**
* @var ServiceLocatorInterface
*/
protected $hydrators;
/**
* Constructor
*
* @param ServiceLocatorInterface $hydrators
*/
public function __construct(ServiceLocatorInterface $hydrators) {
$this->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));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DelegatingHydrator:: |
protected | property | ||
DelegatingHydrator:: |
public | function |
Extract values from an object Overrides ExtractionInterface:: |
|
DelegatingHydrator:: |
protected | function | Gets hydrator of an object | |
DelegatingHydrator:: |
public | function |
Hydrate $object with the provided $data. Overrides HydrationInterface:: |
|
DelegatingHydrator:: |
public | function | Constructor |