DataTransformerChain
in package
implements
DataTransformerInterface
Passes a value through multiple value transformers.
Tags
Interfaces, Classes, Traits and Enums
- DataTransformerInterface
- Transforms a value between different representations.
Table of Contents
- $transformers : mixed
- __construct() : mixed
- Uses the given value transformers to transform values.
- getTransformers() : array<string|int, DataTransformerInterface>
- reverseTransform() : mixed
- Passes the value through the reverseTransform() method of all nested transformers.
- transform() : mixed
- Passes the value through the transform() method of all nested transformers.
Properties
$transformers
protected
mixed
$transformers
Methods
__construct()
Uses the given value transformers to transform values.
public
__construct(array<string|int, DataTransformerInterface> $transformers) : mixed
Parameters
- $transformers : array<string|int, DataTransformerInterface>
Return values
mixed —getTransformers()
public
getTransformers() : array<string|int, DataTransformerInterface>
Return values
array<string|int, DataTransformerInterface> —reverseTransform()
Passes the value through the reverseTransform() method of all nested transformers.
public
reverseTransform(mixed $value) : mixed
The transformers receive the value in the reverse order as they were passed to the constructor. Each transformer receives the result of the previous transformer as input. The output of the last transformer is returned by this method.
Parameters
- $value : mixed
-
The transformed value
Tags
Return values
mixed —The reverse-transformed value
transform()
Passes the value through the transform() method of all nested transformers.
public
transform(mixed $value) : mixed
The transformers receive the value in the same order as they were passed to the constructor. Each transformer receives the result of the previous transformer as input. The output of the last transformer is returned by this method.
Parameters
- $value : mixed
-
The original value
Tags
Return values
mixed —The transformed value