<?php


namespace AutoAdmin\Bundle\Admin\Controller\Admin;

use AutoAdmin\Bundle\Cache\Service\CacheService;
use Symfony\Component\HttpFoundation\Request;

class CacheRuleController extends EntityController
{
    private CacheService $cacheService;

    /**
     * @required
     */
    public function setCacheService(CacheService $service)
    {
        $this->cacheService = $service;
    }

    public function cacheClear(Request $request)
    {
        $this->cacheService->clearCachedResponse();

        return $this->redirect($request->headers->get('referer'));
    }
}
