__construct()
addFilter()
addStrategy()
extract()
extractName()
extractValue()
getFilter()
getNamingStrategy()
getStrategy()
getUnderscoreSeparatedKeys()
hasFilter()
hasNamingStrategy()
hasStrategy()
hydrate()
hydrateName()
hydrateValue()
removeFilter()
removeNamingStrategy()
removeStrategy()
setNamingStrategy()
setOptions()
setUnderscoreSeparatedKeys()
resetCaches()
$filterComposite
$namingStrategy
$strategies
$underscoreSeparatedKeys
$callableMethodFilter
$extractionMethodsCache
$hydrationMethodsCache
__construct(bool | array $underscoreSeparatedKeys)
boolarray
addFilter(string $name, \Zend\Stdlib\Hydrator\callable | \Zend\Stdlib\Hydrator\Filter\FilterInterface $filter, int $condition) : \Zend\Stdlib\Hydrator\Filter\FilterComposite
To exclude e.g. the method getServiceLocator:
$composite->addFilter("servicelocator",
function ($property) {
list($class, $method) = explode('::', $property);
if ($method === 'getServiceLocator') {
return false;
}
return true;
}, FilterComposite::CONDITION_AND
);
string
Index in the composite
\Zend\Stdlib\Hydrator\callable\Zend\Stdlib\Hydrator\Filter\FilterInterface
int
addStrategy(string $name, \Zend\Stdlib\Hydrator\Strategy\StrategyInterface $strategy) : \Zend\Stdlib\Hydrator\HydratorInterface
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::addStrategy() |
---|
string
The name of the strategy to register.
extract(object $object) : array
Extracts the getter/setter of the given $object.
object
\Zend\Stdlib\Exception\BadMethodCallException |
for a non-object $object |
---|
array
extractName(string $name, null $object) : mixed
If no naming strategy exists, the plain value is returned.
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::extractName() |
---|
string
The name to convert.
null
The object is optionally provided as context.
mixed
extractValue(string $name, mixed $value, mixed $object) : mixed
If no strategy exists the plain value is returned.
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::extractValue() |
---|
string
The name of the strategy to use.
mixed
The value that should be converted.
mixed
The object is optionally provided as context.
mixed
getFilter() : \Zend\Stdlib\Hydrator\Filter\FilterComposite
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::getFilter() |
---|
getNamingStrategy() : \Zend\Stdlib\Hydrator\NamingStrategy\NamingStrategyInterface
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::getNamingStrategy() |
---|
getStrategy(string $name) : \Zend\Stdlib\Hydrator\Strategy\StrategyInterface
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::getStrategy() |
---|
string
The name of the strategy to get.
\Zend\Stdlib\Exception\InvalidArgumentException |
---|
getUnderscoreSeparatedKeys() : bool
bool
hasFilter(string $name) : bool
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::hasFilter() |
---|
string
Index in the composite
bool
hasNamingStrategy() : bool
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::hasNamingStrategy() |
---|
bool
hasStrategy(string $name) : bool
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::hasStrategy() |
---|
string
The name of the strategy to check for.
bool
hydrate(array $data, object $object) : object
Hydrates an object by getter/setter methods of the object.
array
object
\Zend\Stdlib\Exception\BadMethodCallException |
for a non-object $object |
---|
object
hydrateName(string $name, array $data) : mixed
If no naming strategy exists, the plain value is returned.
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::hydrateName() |
---|
string
The name to convert.
array
The whole data is optionally provided as context.
mixed
hydrateValue(string $name, mixed $value, array $data) : mixed
If no strategy exists the plain value is returned.
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::hydrateValue() |
---|
string
The name of the strategy to use.
mixed
The value that should be converted.
array
The whole data is optionally provided as context.
mixed
removeFilter($name) : \Zend\Stdlib\Hydrator\Filter\FilterComposite
To not extract "has" methods, you simply need to unregister it
$filterComposite->removeFilter('has');
removeNamingStrategy() : \Zend\Stdlib\Hydrator\self
\Zend\Stdlib\Hydrator\self
removeStrategy(string $name) : \Zend\Stdlib\Hydrator\HydratorInterface
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::removeStrategy() |
---|
string
The name of the strategy to remove.
setNamingStrategy(\Zend\Stdlib\Hydrator\NamingStrategy\NamingStrategyInterface $strategy) : \Zend\Stdlib\Hydrator\self
\Zend\Stdlib\Hydrator\self
setOptions(array | \Traversable $options) : \Zend\Stdlib\Hydrator\ClassMethods
array\Traversable
\Zend\Stdlib\Exception\InvalidArgumentException |
---|
setUnderscoreSeparatedKeys(bool $underscoreSeparatedKeys) : \Zend\Stdlib\Hydrator\ClassMethods
resetCaches()
$filterComposite : \Zend\Stdlib\Hydrator\Filter\FilterComposite
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::$$filterComposite |
---|
$namingStrategy : \Zend\Stdlib\Hydrator\NamingStrategy\NamingStrategyInterface
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::$$namingStrategy |
---|
$strategies : \ArrayObject
inherited_from | \Zend\Stdlib\Hydrator\AbstractHydrator::$$strategies |
---|
$underscoreSeparatedKeys : bool
$extractionMethodsCache : \Zend\Stdlib\Hydrator\string[][]
$hydrationMethodsCache : string[] | bool[]