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

setIssue() public method

Set the issue that is the owner of this settings.
public setIssue ( Issue $issue ) : Newscoop\Entity\OutputSettingsIssue
$issue Newscoop\Entity\Issue The issue that is the owner of this settings, must not be null or empty.
return Newscoop\Entity\OutputSettingsIssue This object for chaining purposes.
    public function setIssue(Issue $issue)
    {
        Validation::notEmpty($issue, 'issue');
        $this->issue = $issue;
        return $this;
    }

Usage Example

Example #1
0
}
//@New theme management
$resourceId = new ResourceId('Publication/Edit');
$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));
All Usage Examples Of Newscoop\Entity\Output\OutputSettingsIssue::setIssue