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);
}