| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function populateCollection(GetResponseForControllerResultEvent $event): void |
||
| 31 | { |
||
| 32 | $collectionEntity = $event->getControllerResult(); |
||
| 33 | $method = $event->getRequest()->getMethod(); |
||
| 34 | |||
| 35 | if (!$collectionEntity instanceof Collection || Request::METHOD_GET !== $method) { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** @var ContextAwareCollectionDataProviderInterface $dataProvider */ |
||
| 40 | $dataProvider = $this->container->get(ContextAwareCollectionDataProviderInterface::class); |
||
| 41 | $dataProviderContext = []; |
||
| 42 | $collection = $dataProvider->getCollection($collectionEntity->getResource(), Request::METHOD_GET, $dataProviderContext); |
||
| 43 | $collectionEntity->setCollection($collection); |
||
| 44 | } |
||
| 46 |