<?php
declare(strict_types=1);
namespace App\Controller\V1;
use App\Repository\LocationRepository;
use FOS\RestBundle\Controller\Annotations as Rest;
use Nelmio\ApiDocBundle\Annotation\Model;
use Swagger\Annotations as SWG;
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route("/locations")
* @SWG\Tag(name="Cinema_v1")
*/
class LocationController
{
/** @var LocationRepository */
protected $locationRepository;
public function __construct(LocationRepository $locationRepository)
{
$this->locationRepository = $locationRepository;
}
/**
* @Route("", methods={"GET"})
* @Rest\View()
* @SWG\Response(
* response="200",
* description="Success",
* @SWG\Schema(type="array", items=@SWG\Items(ref=@Model(type=\App\Entity\Local\Location::class)))
* )
* @return array
*/
public function indexAction()
{
return $this->locationRepository->findAll();
}
}