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

findOutputSetting() public method

public findOutputSetting ( Theme $theme, Output $output )
$theme Newscoop\Entity\Theme
$output Newscoop\Entity\Output
    public function findOutputSetting(Theme $theme, Output $output)
    {
        Validation::notEmpty($theme, 'theme');
        Validation::notEmpty($output, 'output');
        $xml = $this->loadXML($this->toFullPath($theme, $this->themeConfigFileName));
        if ($xml != NULL) {
            $nodes = $this->getNodes($xml, self::TAG_OUTPUT);
            foreach ($nodes as $node) {
                /* @var $node \SimpleXMLElement */
                try {
                    $outputName = $this->readAttribute($node, self::ATTR_OUTPUT_NAME);
                    if ($output->getName() == $outputName) {
                        $oset = $this->loadOutputSetting($node, $theme->getPath());
                        $oset->setOutput($output);
                        return $oset;
                    }
                } catch (FailedException $e) {
                    // Nothing to do.
                }
            }
        }
        return NULL;
    }