mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-04 01:09:25 -05:00
NodeAction: make node optional
This is required for root nodes
This commit is contained in:
parent
a2ea908480
commit
7f3c16466a
1 changed files with 9 additions and 2 deletions
|
|
@ -32,9 +32,11 @@ abstract class NodeAction
|
|||
*
|
||||
* @param Node|string $node
|
||||
*/
|
||||
public function __construct($node)
|
||||
public function __construct($node = null)
|
||||
{
|
||||
$this->nodeName = (string) $node;
|
||||
if ($node !== null) {
|
||||
$this->nodeName = (string) $node;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,6 +65,11 @@ abstract class NodeAction
|
|||
return $this->nodeName;
|
||||
}
|
||||
|
||||
public function hasNode()
|
||||
{
|
||||
return $this->nodeName !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is an instance of a given action name
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue