Conditions | 5 |
Paths | 8 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function __construct(Exclusion $exclusion = null, Relation $relation = null) |
||
16 | { |
||
17 | if (null !== $relation) { |
||
18 | $this->name = $relation->getName(); |
||
19 | $this->class = get_class($relation); |
||
20 | |||
21 | $typeParser = new TypeParser(); |
||
22 | if (null !== $relation->getEmbedded()) { |
||
23 | $this->type = $typeParser->parse('Hateoas\Model\Embedded'); |
||
24 | } elseif (null !== $relation->getHref()) { |
||
25 | $this->type = $typeParser->parse('Hateoas\Model\Link'); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | if (null === $exclusion) { |
||
30 | return; |
||
31 | } |
||
32 | |||
33 | $this->groups = $exclusion->getGroups(); |
||
34 | $this->sinceVersion = $exclusion->getSinceVersion(); |
||
35 | $this->untilVersion = $exclusion->getUntilVersion(); |
||
36 | $this->maxDepth = $exclusion->getMaxDepth(); |
||
37 | } |
||
38 | } |
||
39 |