Newscoop\Service\Implementation\ThemeManagementServiceLocal::getThemesData PHP Method

getThemesData() private method

private getThemesData ( $publication, SearchTheme $search = NULL )
$search Newscoop\Service\Model\SearchTheme
    private function getThemesData($publication, SearchTheme $search = NULL)
    {
        Validation::notEmpty($publication, 'publication');
        if ($publication instanceof Publication) {
            Validation::notEmpty($publication->getId(), 'publication.id');
            $publicationId = $publication->getId();
        } else {
            $publicationId = $publication;
        }
        $allConfigs = $this->findAllThemesConfigPaths();
        $configs = array();
        $pubFolder = self::FOLDER_PUBLICATION_PREFIX . $publicationId;
        $length = strlen($pubFolder);
        foreach ($allConfigs as $id => $config) {
            if (strncmp($config, $pubFolder, $length) == 0) {
                $configs[$id] = $config;
            }
        }
        $themes = $this->loadThemes($configs);
        if ($search !== NULL) {
            $themes = $this->filterThemes($search, $themes);
        }
        return $themes;
    }