Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function indexAction(LayoutBoxSettingsCollection $boxSettings): Response |
||
21 | { |
||
22 | $dataset = $this->get('news.dataset.front'); |
||
23 | $requestHelper = $this->getRequestHelper(); |
||
24 | |||
25 | $conditions = new ConditionsCollection(); |
||
26 | $conditions->add(new Eq('publish', true)); |
||
27 | |||
28 | $conditions = $this->get('layered_navigation.helper')->addLayeredNavigationConditions($conditions); |
||
29 | |||
30 | $newsFeed = $dataset->getResult('array', [ |
||
31 | 'limit' => $boxSettings->getParam('per_page', 12), |
||
32 | 'page' => $requestHelper->getAttributesBagParam('page', 1), |
||
33 | 'order_by' => 'startDate', |
||
34 | 'order_dir' => 'desc', |
||
35 | 'conditions' => $conditions, |
||
36 | ]); |
||
37 | |||
38 | return $this->displayTemplate('index', [ |
||
39 | 'dataset' => $newsFeed, |
||
40 | 'boxSettings' => $boxSettings, |
||
41 | ]); |
||
42 | } |
||
43 | } |