category Zend
package Zend_Stdlib
subpackage Hydrator

 Methods

Initializes a new instance of this class.

__construct() 
Inherited

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::__construct()

Adds the given strategy under the given name.

addStrategy(string $name, \Zend\Stdlib\Hydrator\Strategy\StrategyInterface $strategy) : \Zend\Stdlib\Hydrator\HydratorInterface
Inherited

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::addStrategy()

Parameters

$name

string

The name of the strategy to register.

$strategy

\Zend\Stdlib\Hydrator\Strategy\StrategyInterface

The strategy to register.

Returns

Extract values from the provided object

extract(object $object) : array

Extracts values via the object's getArrayCopy() method.

Parameters

$object

object

Exceptions

\Zend\Stdlib\Exception\BadMethodCallException for an $object not implementing getArrayCopy()

Returns

array

Converts a value for extraction.

extractValue(string $name, mixed $value) : mixed
Inherited

If no strategy exists the plain value is returned.

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::extractValue()

Parameters

$name

string

The name of the strategy to use.

$value

mixed

The value that should be converted.

Returns

mixed

Gets the strategy with the given name.

getStrategy(string $name) : \Zend\Stdlib\Hydrator\Strategy\StrategyInterface
Inherited

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::getStrategy()

Parameters

$name

string

The name of the strategy to get.

Returns

Checks if the strategy with the given name exists.

hasStrategy(string $name) : bool
Inherited

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::hasStrategy()

Parameters

$name

string

The name of the strategy to check for.

Returns

bool

Hydrate an object

hydrate(array $data, object $object) : object

Hydrates an object by passing $data to either its exchangeArray() or populate() method.

Parameters

$data

array

$object

object

Exceptions

\Zend\Stdlib\Exception\BadMethodCallException for an $object not implementing exchangeArray() or populate()

Returns

object

Converts a value for hydration.

hydrateValue(string $name, mixed $value) : mixed
Inherited

If no strategy exists the plain value is returned.

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::hydrateValue()

Parameters

$name

string

The name of the strategy to use.

$value

mixed

The value that should be converted.

Returns

mixed

Removes the strategy with the given name.

removeStrategy(string $name) : \Zend\Stdlib\Hydrator\HydratorInterface
Inherited

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::removeStrategy()

Parameters

$name

string

The name of the strategy to remove.

Returns

 Properties

 

The list with strategies that this hydrator has.

$strategies : \ArrayObject
Inherited

inherited_from \Zend\Stdlib\Hydrator\AbstractHydrator::$$strategies