Newscoop\Entity\Output\OutputSettingsIssue::setThemePath PHP Method

setThemePath() public method

Set the path of the theme associated.
public setThemePath ( Resource $themePath ) : Newscoop\Entity\PublicationTheme
$themePath Newscoop\Entity\Resource The path of the theme, must not be null or empty.
return Newscoop\Entity\PublicationTheme This object for chaining purposes.
    public function setThemePath(Resource $themePath)
    {
        Validation::notEmpty($themePath, 'themePath');
        $this->themePath = $themePath;
        return $this;
    }

Usage Example

Beispiel #1
0
$themeManagementService = $resourceId->getService(IThemeManagementService::NAME_1);
$outputSettingIssueService = $resourceId->getService(IOutputSettingIssueService::NAME);
$outputService = $resourceId->getService(IOutputService::NAME);
$issueService = $resourceId->getService(IIssueService::NAME);
$syncRsc = $resourceId->getService(ISyncResourceService::NAME);
$newOutputSetting = false;
$outSetIssues = $outputSettingIssueService->findByIssue($issueObj->getIssueId());
if (count($outSetIssues) > 0) {
    $outSetIssue = $outSetIssues[0];
} else {
    $outSetIssue = new OutputSettingsIssue();
    $outSetIssue->setOutput($outputService->findByName('Web'));
    $outSetIssue->setIssue($issueService->getById($issueObj->getIssueId()));
    $newOutputSetting = true;
}
$outSetIssue->setThemePath($syncRsc->getThemePath($f_theme_id));
if ($f_issue_template_id != null && $f_issue_template_id != '0') {
    $outSetIssue->setFrontPage($syncRsc->getResource('frontPage', $f_issue_template_id));
} else {
    $outSetIssue->setFrontPage(null);
}
if ($f_section_template_id != null && $f_section_template_id != '0') {
    $outSetIssue->setSectionPage($syncRsc->getResource('sectionPage', $f_section_template_id));
} else {
    $outSetIssue->setSectionPage(null);
}
if ($f_article_template_id != null && $f_article_template_id != '0') {
    $outSetIssue->setArticlePage($syncRsc->getResource('articlePage', $f_article_template_id));
} else {
    $outSetIssue->setArticlePage(null);
}
All Usage Examples Of Newscoop\Entity\Output\OutputSettingsIssue::setThemePath