* many things

This commit is contained in:
Danyi Dávid
2020-04-23 18:26:12 +02:00
parent 7283d6eefb
commit 3cafc2996e
47 changed files with 3232 additions and 1362 deletions

35
src/App/Handler/Album.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace App\Handler;
use ApiLibs\AbstractHandler\CrudHandler;
use App\Service\GalleryService;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
class Album extends CrudHandler
{
private $galleryService;
public function __construct(GalleryService $galleryService)
{
$this->galleryService = $galleryService;
}
/**
* @param ServerRequestInterface $request
* @return ResponseInterface
* @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException
* @throws \Doctrine\ORM\TransactionRequiredException
*/
public function get(ServerRequestInterface $request): ResponseInterface
{
$id = (int)$request->getAttribute('id');
return new JsonResponse($this->galleryService->getAlbum($id));
}
}