EventService: refactoring

This commit is contained in:
Eric Espie
2022-03-15 17:50:13 +01:00
parent 5b52ca4776
commit 29c6b73d93
30 changed files with 914 additions and 889 deletions

View File

@@ -564,6 +564,8 @@ class ModelFactory
$this->oMeta = $this->oDOMDocument->CreateElement('meta');
$this->oRoot->AppendChild($this->oMeta);
$this->oMeta = $this->oDOMDocument->CreateElement('events');
$this->oRoot->AppendChild($this->oMeta);
foreach ($aRootNodeExtensions as $sElementName)
{
@@ -844,6 +846,14 @@ class ModelFactory
$oNode->SetAttribute('_created_in', $sModuleName);
}
}
$oNodeList = $oXPath->query('/itop_design/events/event');
foreach ($oNodeList as $oNode)
{
if ($oNode->getAttribute('_created_in') == '')
{
$oNode->SetAttribute('_created_in', $sModuleName);
}
}
$oNodeList = $oXPath->query('/itop_design/menus/menu');
foreach ($oNodeList as $oNode)
{
@@ -1236,6 +1246,19 @@ EOF
return $this->GetNodes("/itop_design/constants/constant[@_created_in='$sModuleName']");
}
/**
* List all events from the DOM, for a given module
*
* @param string $sModuleName
*
* @return \DOMNodeList
* @throws Exception
*/
public function ListEvents($sModuleName)
{
return $this->GetNodes("/itop_design/events/event[@_created_in='$sModuleName']");
}
/**
* List all classes from the DOM, for a given module
*