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

package Zend\Stdlib\Hydrator\Strategy

 Methods

__construct()

__construct(int | string $trueValue, int | string $falseValue) 

Parameters

$trueValue

intstring

$falseValue

intstring

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

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

extract(bool $value) : int | string

Parameters

$value

bool

The original value.

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Returns

intstringReturns the value that should be extracted.

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

hydrate(int | string $value) : bool

Parameters

$value

intstring

The original value.

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Returns

boolReturns the value that should be hydrated.

 Properties

 

$falseValue

$falseValue : int | string

 

$trueValue

$trueValue : int | string