Refactored code

This commit is contained in:
Kevin Frantz
2019-04-14 14:44:04 +02:00
parent 8b06927936
commit 0e1d5ea024
6 changed files with 18 additions and 54 deletions

View File

@@ -3,46 +3,10 @@
namespace Infinito\Controller\API;
use Infinito\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
/**
* @author kevinfrantz
*
* @todo Implement!
*
* @see https://de.wikipedia.org/wiki/CRUD
*/
abstract class AbstractAPIController extends AbstractController
{
/*
* @param Request $request HTTP Method POST with the object attributes as parameters
*
* @return Response
*/
// abstract public function create(Request $request, SecureCRUDFactoryService $crudFactory): Response;
/*
* @param Request $request HTTP Method GET
* @param int|string $identifier The slug or id of the object
*
* @return Response
*/
// abstract public function read(Request $request, $identifier): Response;
/*
* @param Request $request HTTP Method PUT
* @param int|string $identifier The slug or id of the object
*
* @return Response
*/
// abstract public function update(Request $request, $identifier): Response;
/*
* @param Request $request HTTP Method DELETE with the object attributes as parameters
* @param int|string $identifier The slug or id of the object
*
* @return Response
*/
// abstract public function delete(Request $request, $identifier): Response;
}

View File

@@ -29,12 +29,22 @@ final class LayerController extends AbstractAPIController
/**
* @var string
*/
const IDENTITY_PARAMETER_KEY = 'identity';
public const IDENTITY_PARAMETER_KEY = 'identity';
/**
* @var string
*/
const LAYER_PARAMETER_KEY = 'layer';
public const LAYER_PARAMETER_KEY = 'layer';
/**
* @var string
*/
public const LAYER_GET_ROUTE = 'infinito_api_rest_layer_read';
/**
* @var string
*/
public const LAYER_CREATE_ROUTE = 'infinito_api_rest_layer_create';
/**
* @Route(