protected function loadTheme(\SimpleXMLElement $nodeTheme, $id, $themeConfig)
{
if ($nodeTheme->getName() !== self::TAG_THEME) {
$this->getErrorHandler()->error(ThemeErrors::XML_NO_ROOT);
return NULL;
}
$theme = new Theme();
$theme->setId($id);
$theme->setPath($this->extractRelativePathFrom($themeConfig));
try {
$theme->setName($this->readAttribute($nodeTheme, self::ATTR_THEME_NAME));
$theme->setDesigner($this->readAttribute($nodeTheme, self::ATTR_THEME_DESIGNER));
$theme->setVersion($this->readAttribute($nodeTheme, self::ATTR_THEME_VERSION));
$theme->setMinorNewscoopVersion($this->readAttribute($nodeTheme, self::ATTR_THEME_NEWSCOOP_VERSION));
$theme->setDescription($nodeTheme->{self::TAG_DESCRIPTION}->__toString());
} catch (XMLMissingAttribueException $e) {
$this->getErrorHandler()->error(ThemeErrors::XML_MISSING_ATTRIBUTE, $e->getAttributeName(), $nodeTheme->getName());
return NULL;
}
return $theme;
}