Methods |
public
|
entity<T is SyncEntityInterface>(class-string<T> $value): static<T>
Entity to which the rules apply (required)
Entity to which the rules apply (required)
|
#
|
public
|
inherit<T is SyncEntityInterface>(SyncSerializeRules<T>|null $value): static<T>
Inherit rules from another instance
Inherit rules from another instance
|
#
|
public
|
dateFormatter(DateFormatterInterface|null $value): $this
Date formatter used to serialize date and time values
Date formatter used to serialize date and time values
|
#
|
public
|
includeMeta(bool|null $value = true): $this
Serialize undeclared property values? (default: true)
Serialize undeclared property values? (default: true)
|
#
|
public
|
sortByKey(bool|null $value = true): $this
Sort serialized entities by key? (default: false)
Sort serialized entities by key? (default: false)
|
#
|
public
|
maxDepth(int|null $value): $this
Maximum depth of nested values (default: 99)
Maximum depth of nested values (default: 99)
|
#
|
public
|
detectRecursion(bool|null $value = true): $this
Detect recursion when serializing nested entities? (default: true)
Detect recursion when serializing nested entities? (default: true)
|
#
|
public
|
recurseRules(bool|null $value = true): $this
Apply path-based rules to nested instances of the entity? (default: true)
Apply path-based rules to nested instances of the entity? (default: true)
|
#
|
public
|
forSyncStore(bool|null $value = true): $this
Are values being serialized for an entity store? (default: false)
Are values being serialized for an entity store? (default: false)
|
#
|
public
|
includeCanonicalId(bool|null $value = true): $this
Serialize canonical identifiers of sync entities? (default: false)
Serialize canonical identifiers of sync entities? (default: false)
|
#
|
public
|
remove(
array<array<(array{string, ...}&array<(Closure(mixed, SyncStoreInterface|null, SyncSerializeRules<TEntity>): mixed)|int|string|null>)|string>|(array{string, ...}&array<(Closure(mixed, SyncStoreInterface|null, SyncSerializeRules<TEntity>): mixed)|int|string|null>)|string> $value,
): $this
Values to remove, e.g. `[OrgUnit::class => ['users']]` to remove `users` from `OrgUnit` objects
Values to remove, e.g. [OrgUnit::class => ['users']] to remove users from OrgUnit objects
|
#
|
public
|
replace(
array<array<(array{string, ...}&array<(Closure(mixed, SyncStoreInterface|null, SyncSerializeRules<TEntity>): mixed)|int|string|null>)|string>|(array{string, ...}&array<(Closure(mixed, SyncStoreInterface|null, SyncSerializeRules<TEntity>): mixed)|int|string|null>)|string> $value,
): $this
Values to replace, e.g. `[User::class => [['org_unit', 'org_unit_id', fn($ou) => $ou->Id]]]` to replace `"org_unit" => …
Values to replace, e.g. [User::class => [['org_unit', 'org_unit_id', fn($ou) => $ou->Id]]] to replace "org_unit" => $entity with "org_unit_id" => $entity->Id in User objects
|
#
|