Newscoop\Entity\Output\OutputSettingsSection::setSection PHP Méthode

setSection() public méthode

Set the section that is the owner of this settings.
public setSection ( Section $section ) : Newscoop\Entity\OutputSettingsSection
$section Newscoop\Entity\Section The section that is the owner of this settings, must not be null or empty.
Résultat Newscoop\Entity\OutputSettingsSection This object for chaining purposes.
    public function setSection(Section $section)
    {
        Validation::notEmpty($section, 'section');
        $this->section = $section;
        return $this;
    }

Usage Example

Exemple #1
0
 $modified &= $sectionObj->setDescription($cDescription);
 //@New theme management
 $resourceId = new ResourceId('Section/Edit');
 $outputSettingSectionService = $resourceId->getService(IOutputSettingSectionService::NAME);
 $outputService = $resourceId->getService(IOutputService::NAME);
 $sectionService = $resourceId->getService(ISectionService::NAME);
 $syncRsc = $resourceId->getService(ISyncResourceService::NAME);
 $newOutputSetting = false;
 $dSection = $sectionService->getById($sectionObj->getSectionId());
 $outSetSections = $outputSettingSectionService->findBySection($dSection);
 if (count($outSetSections) > 0) {
     $outSetSection = $outSetSections[0];
 } else {
     $outSetSection = new OutputSettingsSection();
     $outSetSection->setOutput($outputService->findByName('Web'));
     $outSetSection->setSection($dSection);
     $newOutputSetting = true;
 }
 if ($cSectionTplId != null && $cSectionTplId != '0') {
     $outSetSection->setSectionPage($syncRsc->getResource('sectionPage', $cSectionTplId));
 } else {
     $outSetSection->setSectionPage(null);
 }
 if ($cArticleTplId != null && $cArticleTplId != '0') {
     $outSetSection->setArticlePage($syncRsc->getResource('articlePage', $cArticleTplId));
 } else {
     $outSetSection->setArticlePage(null);
 }
 //@New theme management
 if ($cSubs == "a") {
     $numSubscriptionsAdded = Subscription::AddSectionToAllSubscriptions($Pub, $Section);
All Usage Examples Of Newscoop\Entity\Output\OutputSettingsSection::setSection