1 | <?php |
||
9 | final class GroupPolicy implements PolicyInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | const ATTRIBUTE_GROUPS = 'groups'; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | const GROUP_DEFAULT = 'default'; |
||
20 | |||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | private $groups; |
||
25 | |||
26 | /** |
||
27 | * @param array $groups |
||
28 | */ |
||
29 | 5 | public function __construct(array $groups = [self::GROUP_DEFAULT]) |
|
33 | |||
34 | /** |
||
35 | * @param DenormalizerContextInterface $context |
||
36 | * @param object|mixed $object |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | 5 | public function isCompliant(DenormalizerContextInterface $context, $object): bool |
|
56 | } |
||
57 |