final class TransformationContext

Methods

__construct(bool $transformValues = true, bool $mapPropertyNames = true, bool $constructable = false, PartialTree|null $include = null, PartialTree|null $exclude = null, PartialTree|null $only = null, PartialTree|null $except = null, array $partialDefinitions = ['include' => [], 'exclude' => [], 'only' => [], 'except' => []], array $transformers = [], WrapExecutionType $wrapExecutionType = WrapExecutionType::Disabled, int $depth = 0, int|null $maxDepth = null)

Create an immutable transformation context.

bool
hasPartials()

Determine if this operation has partial selections.

withMergedPartials(array $partialDefinitions)

Merge resolved instance partials into this context.

withWrapExecutionType(WrapExecutionType $wrapExecutionType)

Create the same context with different wrapping behavior.

array
partialsForNestedProperty(string $property)

Resolve partial definitions for a raw nested property.

child(string $property, WrapExecutionType|null $wrapExecutionType = null)

Create the context for one nested property.

Details

at line 19
__construct(bool $transformValues = true, bool $mapPropertyNames = true, bool $constructable = false, PartialTree|null $include = null, PartialTree|null $exclude = null, PartialTree|null $only = null, PartialTree|null $except = null, array $partialDefinitions = ['include' => [], 'exclude' => [], 'only' => [], 'except' => []], array $transformers = [], WrapExecutionType $wrapExecutionType = WrapExecutionType::Disabled, int $depth = 0, int|null $maxDepth = null)

Create an immutable transformation context.

Parameters

bool $transformValues
bool $mapPropertyNames
bool $constructable
PartialTree|null $include
PartialTree|null $exclude
PartialTree|null $only
PartialTree|null $except
array $partialDefinitions
array $transformers
WrapExecutionType $wrapExecutionType
int $depth
int|null $maxDepth

at line 43
bool hasPartials()

Determine if this operation has partial selections.

Return Value

bool

at line 56
TransformationContext withMergedPartials(array $partialDefinitions)

Merge resolved instance partials into this context.

Parameters

array $partialDefinitions

Return Value

TransformationContext

at line 85
TransformationContext withWrapExecutionType(WrapExecutionType $wrapExecutionType)

Create the same context with different wrapping behavior.

Parameters

WrapExecutionType $wrapExecutionType

Return Value

TransformationContext

at line 108
array partialsForNestedProperty(string $property)

Resolve partial definitions for a raw nested property.

Parameters

string $property

Return Value

array

at line 131
TransformationContext child(string $property, WrapExecutionType|null $wrapExecutionType = null)

Create the context for one nested property.

Parameters

string $property
WrapExecutionType|null $wrapExecutionType

Return Value

TransformationContext