24 $review = $this->reviewFactory->create()->load($reviewId);
26 $this->messageManager->addError(
__(
'The review was removed by another user or does not exist.'));
31 $arrRatingId = $this->
getRequest()->getParam(
'ratings', []);
34 ->getResourceCollection()
35 ->setReviewFilter($reviewId)
39 foreach ($arrRatingId as $ratingId =>
$optionId) {
40 if ($vote = $votes->getItemByColumnValue(
'rating_id', $ratingId)) {
41 $this->ratingFactory->create()
42 ->setVoteId($vote->getId())
46 $this->ratingFactory->create()
47 ->setRatingId($ratingId)
55 $this->messageManager->addSuccess(
__(
'You saved the review.'));
57 $this->messageManager->addError($e->getMessage());
58 }
catch (\Exception $e) {
59 $this->messageManager->addException($e,
__(
'Something went wrong while saving this review.'));
63 $nextId = (int)$this->
getRequest()->getParam(
'next_item');
65 $resultRedirect->setPath(
'review/*/edit', [
'id' => $nextId]);
67 $resultRedirect->setPath(
'*/*/pending');
69 $resultRedirect->setPath(
'*/*/');
71 return $resultRedirect;
73 $resultRedirect->setPath(
'review/*/');
74 return $resultRedirect;
elseif(isset( $params[ 'redirect_parent']))