class BooleanToStringTransformer implements DataTransformerInterface

Transforms between a Boolean and a string.

Methods

__construct(string $trueValue, array $falseValues = [null])

No description

mixed
transform(mixed $value)

Transforms a Boolean into a string.

mixed
reverseTransform(mixed $value)

Transforms a string into a Boolean.

Details

at line 34
__construct(string $trueValue, array $falseValues = [null])

Parameters

string $trueValue The value emitted upon transform if the input is true
array $falseValues

at line 52
mixed transform(mixed $value)

Transforms a Boolean into a string.

Parameters

mixed $value The value in the original representation

Return Value

mixed The value in the transformed representation

Exceptions

TransformationFailedException if the given value is not a Boolean

at line 74
mixed reverseTransform(mixed $value)

Transforms a string into a Boolean.

Parameters

mixed $value The value in the transformed representation

Return Value

mixed The value in the original representation

Exceptions

TransformationFailedException if the given value is not a string