Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/vendor/iubenda/module-cookiesolution/Controller/Adminhtml/Review/
Upload File :
Current File : //home/rtorresani/www/vendor/iubenda/module-cookiesolution/Controller/Adminhtml/Review/Index.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 Index implements ActionInterface
{

    /**
     * Redirect URL
     *
     * @var string
     */
    private $redirectURL = 'https://iubenda.link/magento-plugin-reviews';

    /**
     * Execute view action
     *
     * @return ResultInterface
     */
    public function execute()
    {
        // Don't show message again
        $this->getInstanceOf(HelperData::class)->permanentHideReviewNotification();

        // 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);
    }
}