mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	Substituted interface through abstract methods to allow the use of services
This commit is contained in:
		@@ -8,7 +8,7 @@ use Symfony\Component\HttpFoundation\Response;
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
interface APIControllerInterface extends CRUDControllerInterface
 | 
			
		||||
interface APIControllerInterface
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @param Request $request HTTP Method GET with filtering parameters
 | 
			
		||||
 
 | 
			
		||||
@@ -3,10 +3,44 @@
 | 
			
		||||
namespace App\Controller\API;
 | 
			
		||||
 | 
			
		||||
use App\Controller\AbstractController;
 | 
			
		||||
use Symfony\Component\HttpFoundation\Response;
 | 
			
		||||
use Symfony\Component\HttpFoundation\Request;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 * @see https://de.wikipedia.org/wiki/CRUD
 | 
			
		||||
 */
 | 
			
		||||
abstract class AbstractAPIController extends AbstractController implements APIControllerInterface
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param Request $request HTTP Method POST with the object attributes as parameters
 | 
			
		||||
     *
 | 
			
		||||
     * @return Response
 | 
			
		||||
     */
 | 
			
		||||
    abstract public function create(Request $request): 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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,10 @@ use Symfony\Component\HttpFoundation\Response;
 | 
			
		||||
use Symfony\Component\HttpFoundation\Request;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Moved functions to
 | 
			
		||||
 * @see AbstractAPIController
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 *
 | 
			
		||||
 * @deprecated Feel free to delete this interface!
 | 
			
		||||
 * @see https://de.wikipedia.org/wiki/CRUD
 | 
			
		||||
 */
 | 
			
		||||
interface CRUDControllerInterface
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user