Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function transformPage(Page $page, $filter = null) : array { |
||
18 | $config = $page->getAdapterConfig(AdapterFactory::LIMIT_ADAPTER); |
||
19 | $config = isset($config['variable']) ? [$config['variable'] => $config] : $config; |
||
20 | |||
21 | foreach ($config as $variable => $limit) { |
||
22 | $entries = $this->getData($page->getVariable($variable)); |
||
23 | $entries = array_slice($entries, 0, $limit); |
||
24 | |||
25 | $page->setVariableValue($variable, $entries) |
||
26 | ->setVariableIsParsed($variable); |
||
27 | } |
||
28 | |||
29 | /** @var Page[] $result */ |
||
30 | $result = [$page->getId() => $page]; |
||
31 | |||
32 | return $result; |
||
33 | } |
||
34 | } |
||
35 |