src/Widgets/ReportWidget.php
public function getResults(array $options = []) : array
    {
        $this->_instance = $this->getReportInstance($options);
        if (null === $this->_instance) {
            return [];
        }

        $config = $this->getReport($options);
        if (empty($config)) {
            return [];
        }

        $this->setConfig($config);
        $this->setContainerId($config);

        $validated = $this->validate($config);

        if (! $validated['status']) {
            throw new RuntimeException("Report validation failed");
        }

        $result = $this->getQueryData($config);

        if (!empty($result)) {
            $this->_instance->getChartData($result);
            $this->setOptions(['scripts' => $this->_instance->getScripts()]);
        }

        return $result;
    }
public function getResults(array $options = []) : array
    {
        $this->_instance = $this->getReportInstance($options);
        if (null === $this->_instance) {
            return [];
        }

        $config = $this->getReport($options);
        if (empty($config)) {
            return [];
        }

        $this->setConfig($config);
        $this->setContainerId($config);

        $validated = $this->validate($config);

        if (! $validated['status']) {
            throw new RuntimeException("Report validation failed");
        }

        $result = $this->getQueryData($config);

        if (!empty($result)) {
            $this->_instance->getChartData($result);
            $this->setOptions(['scripts' => $this->_instance->getScripts()]);
        }

        return $result;
    }
public function getResults ( array $ options = [ ] ) : array { $ this -> _instance = $ this -> getReportInstance ( $ options ) ; if ( null === $ this -> _instance ) { return [ ] ; } $ config = $ this -> getReport ( $ options ) ; if ( empty ( $ config ) ) { return [ ] ; } $ this -> setConfig ( $ config ) ; $ this -> setContainerId ( $ config ) ; $ validated = $ this -> validate ( $ config ) ; if ( ! $ validated [ 'status' ] ) { throw new RuntimeException ( "Report validation failed" ) ; } $ result = $ this -> getQueryData ( $ config ) ; if ( ! empty ( $ result ) ) { $ this -> _instance -> getChartData ( $ result ) ; $ this -> setOptions ( [ 'scripts' => $ this -> _instance -> getScripts ( ) ] ) ; } return $ result ; }
Assembles results data for the report

Establish report data for the widgetHandler.

@param mixed[] $options with entity and view data.
@throws \RuntimeException
@return mixed[] $result containing $_data.
Assembles results data for the report