1 | <?php |
||
14 | class ExclusionManager |
||
15 | { |
||
16 | /** |
||
17 | * @var ExpressionEvaluator |
||
18 | */ |
||
19 | private $expressionEvaluator; |
||
20 | |||
21 | public function __construct(ExpressionEvaluator $expressionEvaluator) |
||
25 | |||
26 | public function shouldSkipLink($object, Relation $relation, SerializationContext $context) |
||
38 | |||
39 | public function shouldSkipEmbedded($object, Relation $relation, SerializationContext $context) |
||
40 | { |
||
41 | if (null === $relation->getEmbedded()) { |
||
42 | return true; |
||
43 | } |
||
44 | |||
45 | if (null === $relation->getEmbedded()->getExclusion()) { |
||
46 | return $this->shouldSkipRelation($object, $relation, $context); |
||
47 | } |
||
48 | |||
49 | return $this->shouldSkip($object, $relation, $relation->getEmbedded()->getExclusion(), $context); |
||
50 | } |
||
51 | |||
52 | private function shouldSkipRelation($object, Relation $relation, SerializationContext $context) |
||
56 | |||
57 | private function shouldSkip($object, Relation $relation, Exclusion $exclusion = null, SerializationContext $context) |
||
76 | } |
||
77 |