From 38ba7ed9721ef2fefc0cf76d37bfbb93eb6b5c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 28 Jan 2015 18:18:57 +0100 Subject: skeleton for DELETE and PATCH methods --- .../ApiBundle/Controller/EntryController.php | 38 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/ApiBundle/Controller/EntryController.php') diff --git a/src/Wallabag/ApiBundle/Controller/EntryController.php b/src/Wallabag/ApiBundle/Controller/EntryController.php index 07ca8ccf..9bf84501 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryController.php @@ -6,17 +6,19 @@ use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Wallabag\CoreBundle\Entity\Entries; use FOS\RestBundle\Controller\Annotations\Get; +use FOS\RestBundle\Controller\Annotations\Delete; +use FOS\RestBundle\Controller\Annotations\Patch; use Wallabag\CoreBundle\Entity\Users; class EntryController extends Controller { /** - * Fetch an entry for a given user + * Fetches an entry for a given user * * @Get("/u/{user}/entry/{entry}") * @ApiDoc( * requirements={ - * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The username"}, + * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} * } * ) @@ -26,4 +28,36 @@ class EntryController extends Controller { return $entry; } + + /** + * Deletes an entry for a given user + * + * @Delete("/u/{user}/entry/{entry}") + * @ApiDoc( + * requirements={ + * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, + * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} + * } + * ) + */ + public function deleteAction(Users $user, Entries $entry) + { + + } + + /** + * Changes several properties of an entry. I.E tags, archived, starred and deleted status + * + * @Patch("/u/{user}/entry/{entry}") + * @ApiDoc( + * requirements={ + * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, + * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} + * } + * ) + */ + public function patchAction(Users $user, Entries $entry) + { + + } } -- cgit v1.2.3