parentName = $parentName; return $this; } /** * @return mixed */ public function getParentName() { return $this->parentName; } /** * @inheritdoc */ public function appliesTo(BpConfig $bp) { $parent = $this->getParentName(); if ($parent === null) { return $bp->hasNode($this->getNodeName()); } else { return $bp->hasNode($this->getNodeName()) && $bp->hasNode($this->getParentName()) ; } } /** * @inheritdoc */ public function applyTo(BpConfig $bp) { $parent = $this->getParentName(); if ($parent === null) { $bp->removeNode($this->getNodeName()); } else { $node = $bp->getNode($this->getNodeName()); $node->removeParent($parent); if (! $node->hasParents()) { $bp->removeNode($this->getNodeName()); } } } }