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

package Zend\Stdlib\Hydrator\Strategy

 Methods

__construct()

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

Parameters

$trueValue

integerstring

$falseValue

integerstring

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

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

extract(boolean $value) : integer | string
inherited_from \Zend\Stdlib\Hydrator\Strategy\StrategyInterface::extract()

Parameters

$value

boolean

The original value.

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Returns

integerstringReturns the value that should be extracted.

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

hydrate(integer|string $value) : boolean
inherited_from \Zend\Stdlib\Hydrator\Strategy\StrategyInterface::hydrate()

Parameters

$value

integerstring

The original value.

Exceptions

\Zend\Stdlib\Exception\InvalidArgumentException

Returns

booleanReturns the value that should be hydrated.

 Properties

 

$falseValue

$falseValue : integer | string

Default

 

$trueValue

$trueValue : integer | string

Default