form = $form; $this->bp = $bp; $this->parent = $parent; $this->_messageVariables['label'] = 'label'; $this->_messageTemplates = [ self::CHILD_FOUND => mt('businessprocess', '%label% is already defined in this process') ]; } public function isValid($value) { if ($this->parent === null) { $found = $this->bp->hasRootNode($value); } elseif ($this->form instanceof EditNodeForm && $this->form->getNode()->getName() === $value) { $found = false; } else { $found = $this->parent->hasChild($value); } if (! $found) { return true; } $this->label = $this->form->getElement('children')->getMultiOptions()[$value]; $this->_error(self::CHILD_FOUND); return false; } }