aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/EntryController.php
blob: 9bf84501f1d40996942100c92aadf5b5d427f3f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php

namespace Wallabag\ApiBundle\Controller;

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
{
    /**
     * Fetches an entry for a given user
     *
     * @Get("/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"}
     *      }
     * )
     * @return Entries
     */
    public function getAction(Users $user, Entries $entry)
    {
        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)
    {

    }
}