Fully Qualified Name: | Zend\Hydrator\ObjectProperty |
Extends: | AbstractHydrator |
Name | Description | Defined By |
---|---|---|
__construct() | Initializes a new instance of this class. | AbstractHydrator |
addFilter() | Add a new filter to take care of what needs to be hydrated. | AbstractHydrator |
addStrategy() | Adds the given strategy under the given name. | AbstractHydrator |
extract() | {@inheritDoc} | ObjectProperty |
extractName() | Convert a name for extraction. If no naming strategy exists, the plain value is returned. | AbstractHydrator |
extractValue() | Converts a value for extraction. If no strategy exists the plain value is returned. | AbstractHydrator |
getFilter() | Get the filter instance | AbstractHydrator |
getNamingStrategy() | Gets the naming strategy. | AbstractHydrator |
getStrategy() | Gets the strategy with the given name. | AbstractHydrator |
hasFilter() | Check whether a specific filter exists at key $name or not | AbstractHydrator |
hasNamingStrategy() | Checks if a naming strategy exists. | AbstractHydrator |
hasStrategy() | Checks if the strategy with the given name exists. | AbstractHydrator |
hydrate() | {@inheritDoc} | ObjectProperty |
hydrateName() | Converts a value for hydration. If no naming strategy exists, the plain value is returned. | AbstractHydrator |
hydrateValue() | Converts a value for hydration. If no strategy exists the plain value is returned. | AbstractHydrator |
removeFilter() | Remove a filter from the composition. | AbstractHydrator |
removeNamingStrategy() | Removes the naming strategy | AbstractHydrator |
removeStrategy() | Removes the strategy with the given name. | AbstractHydrator |
setNamingStrategy() | Adds the given naming strategy | AbstractHydrator |
Initializes a new instance of this class.
Returns:
Add a new filter to take care of what needs to be hydrated.
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
);
Parameter Name | Type | Description |
---|---|---|
$name | string | Index |
$filter | callable|\Filter\FilterInterface | |
$condition | int |
Returns: \Filter\FilterComposite
Adds the given strategy under the given name.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
$strategy | \Strategy\StrategyInterface | The |
Returns: \AbstractHydrator
{@inheritDoc}
Extracts the accessible non-static properties of the given $object.
Parameter Name | Type | Description |
---|---|---|
$object |
Returns:
Convert a name for extraction. If no naming strategy exists, the plain value is returned.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
$object | null | The |
Returns: mixed
Converts a value for extraction. If no strategy exists the plain value is returned.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
$value | mixed | The |
$object | mixed | The |
Returns: mixed
Get the filter instance
Returns: \Filter\FilterComposite
Gets the naming strategy.
Returns: \NamingStrategy\NamingStrategyInterface
Gets the strategy with the given name.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
Returns: \Strategy\StrategyInterface
Check whether a specific filter exists at key $name or not
Parameter Name | Type | Description |
---|---|---|
$name | string | Index |
Returns: bool
Checks if a naming strategy exists.
Returns: bool
Checks if the strategy with the given name exists.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
Returns: bool
{@inheritDoc}
Hydrate an object by populating public properties
Hydrates an object by setting public properties of the object.
Parameter Name | Type | Description |
---|---|---|
$data | ||
$object |
Returns:
Converts a value for hydration. If no naming strategy exists, the plain value is returned.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
$data | array | The |
Returns: mixed
Converts a value for hydration. If no strategy exists the plain value is returned.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
$value | mixed | The |
$data | array | The |
Returns: mixed
Remove a filter from the composition.
To not extract "has" methods, you simply need to unregister it
$filterComposite->removeFilter('has');
Parameter Name | Type | Description |
---|---|---|
$name | ||
$name |
Returns: \Filter\FilterComposite
Removes the naming strategy
Returns: self
Removes the strategy with the given name.
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
Returns: \HydratorInterface
Adds the given naming strategy
Parameter Name | Type | Description |
---|---|---|
$strategy | \NamingStrategy\NamingStrategyInterface | The |
Returns: self