1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Sync; |
4: | |
5: | use Salient\Contract\Sync\Exception\FilterPolicyViolationExceptionInterface; |
6: | |
7: | /** |
8: | * @api |
9: | */ |
10: | interface FilterPolicy |
11: | { |
12: | /** |
13: | * Ignore unclaimed filters |
14: | * |
15: | * The provider may return unfiltered entities, all of which are returned to |
16: | * the caller. |
17: | */ |
18: | public const IGNORE = 0; |
19: | |
20: | /** |
21: | * Throw an exception if there are unclaimed filters |
22: | * |
23: | * A {@see FilterPolicyViolationExceptionInterface} is thrown and the |
24: | * request is not passed to the provider. |
25: | * |
26: | * This is the default policy. |
27: | */ |
28: | public const THROW_EXCEPTION = 1; |
29: | |
30: | /** |
31: | * Return an empty result if there are unclaimed filters |
32: | * |
33: | * The request is not passed to the provider. An empty array (`[]`) is |
34: | * returned to the caller for list operations, otherwise `null` is returned. |
35: | */ |
36: | public const RETURN_EMPTY = 2; |
37: | |
38: | /** |
39: | * Perform local filtering of entities returned by the provider |
40: | * |
41: | * The provider may return unfiltered entities, and any that don't match the |
42: | * unclaimed filters are removed from the result returned to the caller. |
43: | */ |
44: | public const FILTER = 3; |
45: | } |
46: |