BooleanToStringTransformer
in package
implements
DataTransformerInterface
Transforms between a Boolean and a string.
Tags
Interfaces, Classes, Traits and Enums
- DataTransformerInterface
- Transforms a value between different representations.
Table of Contents
- $falseValues : mixed
- $trueValue : mixed
- __construct() : mixed
- reverseTransform() : bool
- Transforms a string into a Boolean.
- transform() : string|null
- Transforms a Boolean into a string.
Properties
$falseValues
private
mixed
$falseValues
$trueValue
private
mixed
$trueValue
Methods
__construct()
public
__construct(string $trueValue[, array<string|int, mixed> $falseValues = [null] ]) : mixed
Parameters
- $trueValue : string
-
The value emitted upon transform if the input is true
- $falseValues : array<string|int, mixed> = [null]
Return values
mixed —reverseTransform()
Transforms a string into a Boolean.
public
reverseTransform(string $value) : bool
Parameters
- $value : string
-
String value
Tags
Return values
bool —Boolean value
transform()
Transforms a Boolean into a string.
public
transform(bool $value) : string|null
Parameters
- $value : bool
-
Boolean value
Tags
Return values
string|null —String value