1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Sync; |
4: | |
5: | /** |
6: | * @api |
7: | */ |
8: | interface DeferralPolicy |
9: | { |
10: | /** |
11: | * Do not resolve deferred entities or relationships |
12: | * |
13: | * If {@see SyncStoreInterface::resolveDeferrals()} is not called manually, |
14: | * unresolved {@see DeferredEntityInterface} and |
15: | * {@see DeferredRelationshipInterface} instances may appear in object |
16: | * graphs returned by sync operations. |
17: | */ |
18: | public const DO_NOT_RESOLVE = 0; |
19: | |
20: | /** |
21: | * Resolve deferred entities and relationships immediately |
22: | * |
23: | * This is the least efficient policy because it produces the most round |
24: | * trips, but it does guarantee the return of fully resolved object graphs. |
25: | */ |
26: | public const RESOLVE_EARLY = 1; |
27: | |
28: | /** |
29: | * Resolve deferred entities and relationships after reaching the end of |
30: | * each stream of entity data |
31: | * |
32: | * This policy minimises the number of round trips to the backend, but |
33: | * unresolved {@see DeferredEntityInterface} and |
34: | * {@see DeferredRelationshipInterface} instances may appear in object |
35: | * graphs until they have been fully traversed. |
36: | */ |
37: | public const RESOLVE_LATE = 2; |
38: | } |
39: |