Newscoop\Controller\Action\Helper\Datatable\ADatatable::dispatchData PHP Метод

dispatchData() публичный Метод

Get data and set the out object
public dispatchData ( array $p_params = null, array $p_cols = null )
$p_params array
$p_cols array
    public function dispatchData($p_params = null, $p_cols = null)
    {
        if (is_null($this->_adapter)) {
            throw new \Exception('No adapter');
        }
        $rows = array();
        $rowHandler = $this->_rowHandler;
        foreach ($theData = $this->_adapter->getData(is_null($p_params) ? $this->_params : $this->setParams($p_params)->_params, is_null($p_cols) ? $this->_cols : $this->setParams($p_cols)->_cols) as $index => $entity) {
            $rows[] = !is_null($rowHandler) ? $rowHandler($entity, $index) : $entity;
        }
        $this->_outputObject->iTotalRecords = $this->_adapter->getCount();
        $this->_outputObject->iTotalDisplayRecords = $this->_adapter->getCount($this->_params, $this->_cols);
        $this->_outputObject->aaData = $rows;
        return $this;
    }