Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function findOrLog(string $code): ?PageInterface |
||
40 | { |
||
41 | $page = $this->pageRepository->findOneEnabledByCode($code, $this->localeContext->getLocaleCode()); |
||
42 | |||
43 | if (false === $page instanceof PageInterface) { |
||
44 | $this->logger->warning(sprintf( |
||
45 | 'Page with "%s" code was not found in the database.', |
||
46 | $code |
||
47 | )); |
||
48 | |||
49 | return null; |
||
50 | } |
||
51 | |||
52 | return $page; |
||
53 | } |
||
55 |