1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Sync;
4:
5: use Salient\Contract\Core\SerializeRulesInterface;
6: use Closure;
7:
8: /**
9: * @api
10: *
11: * @template TEntity of SyncEntityInterface
12: *
13: * @extends SerializeRulesInterface<TEntity>
14: */
15: interface SyncSerializeRulesInterface extends SerializeRulesInterface
16: {
17: /**
18: * @inheritDoc
19: *
20: * @return array<string,array{int|string|null,(Closure(mixed $value, SyncStoreInterface|null $store=): mixed)|null}>
21: */
22: public function getReplaceableKeys(?string $class, ?string $baseClass, array $path): array;
23:
24: /**
25: * Check if values are being serialized for an entity store
26: */
27: public function getForSyncStore(): bool;
28:
29: /**
30: * Get an instance that serializes values for an entity store
31: *
32: * @return static
33: */
34: public function withForSyncStore(?bool $forSyncStore = true);
35:
36: /**
37: * Check if canonical identifiers of sync entities are serialized
38: */
39: public function getIncludeCanonicalId(): bool;
40:
41: /**
42: * Get an instance that serializes canonical identifiers of sync entities
43: *
44: * @return static
45: */
46: public function withIncludeCanonicalId(?bool $include = true);
47: }
48: