<?php
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Contracts\AdminUi\Controller;
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
abstract class Controller extends AbstractController
{
public function performAccessCheck()
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
}
/**
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Location $location
* @param string $uriFragment
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function redirectToLocation(Location $location, string $uriFragment = ''): RedirectResponse
{
return $this->redirectToRoute('ibexa.content.view', [
'contentId' => $location->contentId,
'locationId' => $location->id,
'_fragment' => $uriFragment,
]);
}
}
class_alias(Controller::class, 'EzSystems\EzPlatformAdminUiBundle\Controller\Controller');