| Current Path : /home/rtorresani/www/vendor/iubenda/module-cookiesolution/Controller/Adminhtml/Review/ |
| Current File : //home/rtorresani/www/vendor/iubenda/module-cookiesolution/Controller/Adminhtml/Review/Dismiss.php |
<?php
declare( strict_types=1 );
namespace Iubenda\CookieSolution\Controller\Adminhtml\Review;
use Iubenda\CookieSolution\Helper\Data as HelperData;
use Magento\Framework\App\ActionInterface;
use Magento\Framework\Controller\ResultInterface;
use \Magento\Framework\Controller\Result\Redirect;
use \Magento\Framework\App\ObjectManager;
class Dismiss implements ActionInterface
{
/**
* Redirect URL
*
* @var string
*/
private $redirectURL = 'https://iubenda.link/plugin-feedback';
/**
* Execute view action
*
* @return ResultInterface
*/
public function execute()
{
// Don't show message again
$this->getInstanceOf(HelperData::class)->hideReviewNotification();
// Redirect URL to feedback
$redirect = $this->getInstanceOf(Redirect::class);
$redirect->setUrl($this->redirectURL);
return $redirect;
}
/**
* @param string $class
*
* @return mixed
*/
private function getInstanceOf(string $class)
{
return ObjectManager::getInstance()->get($class);
}
}