src/Event/Model/WidgetsListener.php
private function getReportWidgets(): array
    {
        $event = new Event((string)EventName::MODEL_DASHBOARDS_GET_REPORTS(), $this);
        EventManager::instance()->dispatch($event);

        if (empty($event->result)) {
            return [];
        }

        $result = [];
        foreach ($event->result as $reports) {
            foreach ($reports as $report) {
                if (! isset($result[$report['widget_type']])) {
                    $result[$report['widget_type']] = ['type' => $report['widget_type'], 'data' => []];
                }
                $result[$report['widget_type']]['data'][$report['id']] = $report;
            }
        }

        return array_values($result);
    }
private function getReportWidgets(): array
    {
        $event = new Event((string)EventName::MODEL_DASHBOARDS_GET_REPORTS(), $this);
        EventManager::instance()->dispatch($event);

        if (empty($event->result)) {
            return [];
        }

        $result = [];
        foreach ($event->result as $reports) {
            foreach ($reports as $report) {
                if (! isset($result[$report['widget_type']])) {
                    $result[$report['widget_type']] = ['type' => $report['widget_type'], 'data' => []];
                }
                $result[$report['widget_type']]['data'][$report['id']] = $report;
            }
        }

        return array_values($result);
    }
private function getReportWidgets ( ) : array { $ event = new Event ( ( string ) EventName :: MODEL_DASHBOARDS_GET_REPORTS ( ) , $ this ) ; EventManager :: instance ( ) -> dispatch ( $ event ) ; if ( empty ( $ event -> result ) ) { return [ ] ; } $ result = [ ] ; foreach ( $ event -> result as $ reports ) { foreach ( $ reports as $ report ) { if ( ! isset ( $ result [ $ report [ 'widget_type' ] ] ) ) { $ result [ $ report [ 'widget_type' ] ] = [ 'type' => $ report [ 'widget_type' ] , 'data' => [ ] ] ; } $ result [ $ report [ 'widget_type' ] ] [ 'data' ] [ $ report [ 'id' ] ] = $ report ; } } return array_values ( $ result ) ; }
Fetch all reports through Event broadcast.

@return mixed[]
Fetch all reports through Event broadcast .