Methods |
public
|
getEntity(): class-string<TEntity>
Get the entity to which the instance applies
Get the entity to which the instance applies
Implemented by
|
#
|
public
|
getRecurseRules(): bool
Check if path-based rules are applied to nested instances of the entity
Check if path-based rules are applied to nested instances of the entity
Implemented by
|
#
|
public
|
withRecurseRules(?bool $recurse = true): static
Get an instance that applies path-based rules to nested instances of the
entity
Get an instance that applies path-based rules to nested instances of the
entity
Implemented by
|
#
|
public
|
merge(static $rules): static
Merge with another instance, giving precedence to its values if there are
any conflicts
Merge with another instance, giving precedence to its values if there are
any conflicts
Parameters
$rules |
Must apply to the same entity or one of its
subclasses.
|
Implemented by
|
#
|
public
|
getRemovableKeys<T0 is object, T1 is T0>(
class-string<T1>|null $class,
class-string<T0>|null $baseClass,
string[] $path,
): array<string, string>
Get keys to remove from a serialized class at a given path
Get keys to remove from a serialized class at a given path
If $baseClass is given, rules applied to $class and its parents up to
but not including $baseClass are inherited, otherwise the only
class-based rules used are those applied directly to $class .
Returns
Keys are mapped to themselves.
Implemented by
|
#
|
public
|
getReplaceableKeys<T0 is object, T1 is T0>(
class-string<T1>|null $class,
class-string<T0>|null $baseClass,
string[] $path,
): array<string, array{(string|null), ((Closure(mixed $value): mixed)|null)}>
Get keys to replace in a serialized class at a given path
Get keys to replace in a serialized class at a given path
If $baseClass is given, rules applied to $class and its parents up to
but not including $baseClass are inherited, otherwise the only
class-based rules used are those applied directly to $class .
Returns
Each
key is mapped to an array with two values, one of which may be null :
- a new key for the value
- a closure to return a new value for the key
Implemented by
|
#
|
public
|
getDateFormatter(): ?DateFormatterInterface
Get the date formatter applied to the instance
Get the date formatter applied to the instance
Implemented by
|
#
|
public
|
withDateFormatter(?DateFormatterInterface $formatter): static
Get an instance with a given date formatter
Get an instance with a given date formatter
Implemented by
|
#
|
public
|
getDynamicProperties(): bool
Check if dynamic properties should be included when the entity is
serialized
Check if dynamic properties should be included when the entity is
serialized
Implemented by
|
#
|
public
|
withDynamicProperties(?bool $include = true): static
Get an instance where dynamic properties are included when the entity is
serialized
Get an instance where dynamic properties are included when the entity is
serialized
Implemented by
|
#
|
public
|
getSortByKey(): bool
Check if serialized entities should be sorted by key
Check if serialized entities should be sorted by key
Implemented by
|
#
|
public
|
withSortByKey(?bool $sort = true): static
Get an instance where serialized entities are sorted by key
Get an instance where serialized entities are sorted by key
Implemented by
|
#
|
public
|
getMaxDepth(): int
Get the maximum depth of nested values
Get the maximum depth of nested values
Implemented by
|
#
|
public
|
withMaxDepth(?int $depth): static
Get an instance where the maximum depth of nested values is a given value
Get an instance where the maximum depth of nested values is a given value
Implemented by
|
#
|
public
|
getDetectRecursion(): bool
Check if recursion detection should be enabled when nested entities are
serialized
Check if recursion detection should be enabled when nested entities are
serialized
Implemented by
|
#
|
public
|
withDetectRecursion(?bool $detect = true): static
Get an instance where recursion detection is enabled
Get an instance where recursion detection is enabled
If circular references cannot arise when the entity is serialized,
recursion detection should be disabled to improve performance and reduce
memory consumption.
Implemented by
|
#
|