| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | class DataGridSetDataHandler extends AbstractHandler |
||
| 23 | { |
||
| 24 | public function handleRequest(AdminEvent $event, Request $request): ?Response |
||
| 25 | { |
||
| 26 | $event = $this->validateEvent($event); |
||
| 27 | |||
| 28 | $this->eventDispatcher->dispatch(ListEvents::LIST_DATAGRID_DATA_PRE_BIND, $event); |
||
| 29 | if ($event->hasResponse()) { |
||
| 30 | return $event->getResponse(); |
||
| 31 | } |
||
| 32 | |||
| 33 | $event->getDataGrid()->setData($event->getDataSource()->getResult()); |
||
| 34 | $this->eventDispatcher->dispatch(ListEvents::LIST_DATAGRID_DATA_POST_BIND, $event); |
||
| 35 | |||
| 36 | if ($event->hasResponse()) { |
||
| 37 | return $event->getResponse(); |
||
| 38 | } |
||
| 39 | |||
| 40 | return null; |
||
| 41 | } |
||
| 42 | |||
| 43 | private function validateEvent(AdminEvent $event): ListEvent |
||
| 50 | } |
||
| 51 | } |
||
| 52 |