diff --git a/library/Businessprocess/Node.php b/library/Businessprocess/Node.php index 51f37cb..0d3794d 100644 --- a/library/Businessprocess/Node.php +++ b/library/Businessprocess/Node.php @@ -288,11 +288,38 @@ abstract class Node return count($this->parents) > 0; } + public function hasParentName($name) + { + foreach ($this->getParents() as $parent) { + if ($parent->getName() === $name) { + return true; + } + } + + return false; + } + + public function removeParent($name) + { + $this->parents = array_filter( + $this->parents, + function (BpNode $parent) use ($name) { + return $parent->getName() !== $name; + } + ); + } + public function getParents() { return $this->parents; } + public function getPaths() + { + // TODO! -> for delete etc + return $this->parents; + } + protected function stateToSortState($state) { if (array_key_exists($state, $this->stateToSortStateMap)) {