Conditions | 7 |
Paths | 12 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
36 | public function resolveFromContext($context, $content = null) |
||
37 | { |
||
38 | if (null === $content) { |
||
39 | $content = isset($context['axstrad_content']) |
||
40 | ? $context['axstrad_content'] |
||
41 | : null; |
||
42 | } |
||
43 | |||
44 | if (is_string($content) && |
||
45 | (null === $this->content || $this->content->getReference() != $content) |
||
46 | ) { |
||
47 | $content = $this->repo->findByReference($content)->getOrThrow( |
||
48 | InvalidContentReferenceException::create($content) |
||
49 | ); |
||
50 | } |
||
51 | |||
52 | if ($content instanceof Content) { |
||
53 | $this->content = $content; |
||
54 | } |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
67 |