Newscoop\Service\Implementation\ThemeServiceLocalFileSystem::getCount PHP Method

getCount() public method

public getCount ( Search $search = NULL )
$search Newscoop\Service\Model\Search\Search
    function getCount(Search $search = NULL)
    {
        $themesConfigs = $this->findAllThemesConfigPaths();
        if ($search === NULL) {
            return count($themesConfigs);
        }
        if (!$search instanceof SearchTheme) {
            throw new \Exception("The search needs to be a SearchTheme instance.");
        }
        $themes = $this->loadThemes($themesConfigs);
        var_hook($themes);
        $themes = $this->filterThemes($search, $themes);
        return count($themes);
    }