From 0ea04f898fcfa12f8ce7179eb920ed5748a6c57d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 4 Aug 2023 14:06:53 +0200 Subject: [PATCH] Drop obsolete class `NoDuplicateChildrenValidator` --- .../NoDuplicateChildrenValidator.php | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 library/Businessprocess/Web/Form/Validator/NoDuplicateChildrenValidator.php diff --git a/library/Businessprocess/Web/Form/Validator/NoDuplicateChildrenValidator.php b/library/Businessprocess/Web/Form/Validator/NoDuplicateChildrenValidator.php deleted file mode 100644 index 9676de0..0000000 --- a/library/Businessprocess/Web/Form/Validator/NoDuplicateChildrenValidator.php +++ /dev/null @@ -1,57 +0,0 @@ -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; - } -}