1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Sync; |
4: | |
5: | /** |
6: | * Policies for hydration of sync entities and relationships |
7: | */ |
8: | interface HydrationPolicy |
9: | { |
10: | /** |
11: | * Do not perform hydration |
12: | * |
13: | * Uninitialised relationship properties are ignored. |
14: | */ |
15: | public const SUPPRESS = 0; |
16: | |
17: | /** |
18: | * Perform hydration on demand |
19: | * |
20: | * Relationships are hydrated when they are accessed. |
21: | */ |
22: | public const LAZY = 1; |
23: | |
24: | /** |
25: | * Defer hydration until deferred entities are resolved |
26: | * |
27: | * The {@see DeferralPolicy} applied to the context is also applied to |
28: | * hydration. |
29: | */ |
30: | public const DEFER = 2; |
31: | |
32: | /** |
33: | * Perform hydration on load |
34: | * |
35: | * Relationships are hydrated synchronously when entities are created. |
36: | */ |
37: | public const EAGER = 3; |
38: | } |
39: |