1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Sync;
4:
5: /**
6: * @api
7: */
8: interface HydrationPolicy
9: {
10: /**
11: * Do not perform hydration
12: *
13: * Relationships without data are ignored.
14: */
15: public const SUPPRESS = 0;
16:
17: /**
18: * Perform hydration when deferred entities are resolved
19: *
20: * Relationship hydration is governed by the {@see DeferralPolicy} applied
21: * to the context.
22: */
23: public const DEFER = 1;
24:
25: /**
26: * Perform hydration on demand
27: *
28: * Relationships are hydrated when they are accessed.
29: */
30: public const LAZY = 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: