<?php

namespace Autogedal\FbReviews\Controller\Adminhtml\FbReview;

use Autogedal\FbReviews\Controller\Adminhtml\FbReview;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Backend\App\Action\Context;
use Autogedal\FbReviews\Api\Data\FbReviewInterface;

class NewAction extends FbReview
{
    protected $dataPersistor;

    public function __construct(
        Context $context,
        DataPersistorInterface $dataPersistor,
    ) {
        parent::__construct($context);

        $this->dataPersistor = $dataPersistor;
    }

    public function execute()
    {
        $this->dataPersistor->clear(FbReviewInterface::FORM_NAMESPACE);
        $this->_forward('edit');
    }
}
