Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function execute($cdbid) |
||
37 | { |
||
38 | $document = $this->documentRepository->get($cdbid); |
||
39 | |||
40 | if (!$document) { |
||
41 | throw new EntityNotFoundException('Could not load JSON-LD document for cdbid ' . $cdbid); |
||
42 | } |
||
43 | |||
44 | $json = $document->getBody(); |
||
45 | |||
46 | if (isset($json->mainLanguage)) { |
||
47 | return new Language($json->mainLanguage); |
||
48 | } else { |
||
49 | return $this->fallbackLanguage; |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 |