Class BooleanStrategy

Summary

Fully Qualified Name: Zend\Hydrator\Strategy\BooleanStrategy
Implements: StrategyInterface

Description

This Strategy extracts and hydrates int and string values to Boolean values

Methods

Name Description Defined By
__construct() BooleanStrategy
extract() Converts the given value so that it can be extracted by the hydrator. BooleanStrategy
hydrate() Converts the given value so that it can be hydrated by the hydrator. BooleanStrategy

Method Details

__construct()

Parameter Name Type Description
$trueValue int|string
$falseValue int|string

Returns:

extract()

Converts the given value so that it can be extracted by the hydrator.

Parameter Name Type Description
$value bool The

Returns: int|string Returns the value that should be extracted.

hydrate()

Converts the given value so that it can be hydrated by the hydrator.

Parameter Name Type Description
$value bool|int|string The

Returns: bool Returns the value that should be hydrated.

Top