/** * {@inheritdoc} */ public function onSuccess() { $cmd = new DeleteCommentCommand(); $cmd->setCommentId($this->getElement('comment_id')->getValue())->setCommentName($this->getElement('comment_name')->getValue())->setIsService($this->getElement('comment_is_service')->getValue()); $this->getTransport($this->request)->send($cmd); $redirect = $this->getElement('redirect')->getValue(); if (!empty($redirect)) { $this->setRedirectUrl($redirect); } Notification::success($this->translate('Deleting comment..')); return true; }
/** * {@inheritdoc} */ public function onSuccess() { foreach ($this->comments as $comment) { $cmd = new DeleteCommentCommand(); $cmd->setCommentId($comment->id)->setIsService(isset($comment->service_description)); $this->getTransport($this->request)->send($cmd); } $redirect = $this->getElement('redirect')->getValue(); if (!empty($redirect)) { $this->setRedirectUrl($redirect); } Notification::success($this->translatePlural('Deleting comment..', 'Deleting comments..', count($this->comments))); return true; }