34 $review = $this->reviewFactory->create()->setData(
$data);
38 ->setStoreId(Store::DEFAULT_STORE_ID)
39 ->setStatusId(
$data[
'status_id'])
43 $arrRatingId = $this->
getRequest()->getParam(
'ratings', []);
44 foreach ($arrRatingId as $ratingId =>
$optionId) {
45 $this->ratingFactory->create()
46 ->setRatingId($ratingId)
53 $this->messageManager->addSuccess(
__(
'You saved the review.'));
54 if ($this->
getRequest()->getParam(
'ret') ==
'pending') {
55 $resultRedirect->setPath(
'review/*/pending');
57 $resultRedirect->setPath(
'review/*/');
59 return $resultRedirect;
61 $this->messageManager->addError($e->getMessage());
62 }
catch (\Exception $e) {
63 $this->messageManager->addException($e,
__(
'Something went wrong while saving this review.'));
66 $resultRedirect->setPath(
'review/*/');
67 return $resultRedirect;
elseif(isset( $params[ 'redirect_parent']))