Newscoop\Controller\Action\Helper\Datatable\Adapter\Theme::getCount PHP Метод

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

public getCount ( array $p_params = [], array $cols = [] )
$p_params array
$cols array
    public function getCount(array $p_params = array(), array $cols = array())
    {
        $search = $this->getSearchObject();
        $p_params = (object) $p_params;
        if (isset($p_params->search)) {
            if (@trim($p_params->search[$this->_pubColFilterIdx]) != "") {
                $p = new Publication();
                $p->setId(intval($p_params->search[$this->_pubColFilterIdx]));
                try {
                    return $this->_service->getCountThemes($p, $search);
                } catch (\Exception $e) {
                    return 0;
                }
            }
            $this->search($p_params->search);
        }
        try {
            return $this->_service->getCountUnassignedThemes($search);
        } catch (\Exception $e) {
            return 0;
        }
    }