diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-20 11:45:38 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-03-06 20:50:29 +0100 |
commit | 0f00688096645606c7806a619ca27e6f30ce820c (patch) | |
tree | e4d37db4fa55de871d31625c1c508f899cc8a474 /src/Wallabag/CoreBundle/Entity | |
parent | 73b774438395d0ed74d0fd863194d2ebfb68d9ce (diff) | |
download | wallabag-0f00688096645606c7806a619ca27e6f30ce820c.tar.gz wallabag-0f00688096645606c7806a619ca27e6f30ce820c.tar.zst wallabag-0f00688096645606c7806a619ca27e6f30ce820c.zip |
first draft of hypermedia implementation
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 6 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/User.php | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 937213b4..4f57eb0a 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -4,17 +4,21 @@ namespace Wallabag\CoreBundle\Entity; | |||
4 | 4 | ||
5 | use Doctrine\ORM\Mapping as ORM; | 5 | use Doctrine\ORM\Mapping as ORM; |
6 | use Symfony\Component\Validator\Constraints as Assert; | 6 | use Symfony\Component\Validator\Constraints as Assert; |
7 | use Hateoas\Configuration\Annotation as Hateoas; | ||
8 | use JMS\Serializer\Annotation\XmlRoot; | ||
7 | 9 | ||
8 | /** | 10 | /** |
9 | * Entry | 11 | * Entry |
10 | * | 12 | * |
13 | * @XmlRoot("entry") | ||
11 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") | 14 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") |
12 | * @ORM\Table(name="entry") | 15 | * @ORM\Table(name="entry") |
13 | * @ORM\HasLifecycleCallbacks() | 16 | * @ORM\HasLifecycleCallbacks() |
14 | * | 17 | * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") |
15 | */ | 18 | */ |
16 | class Entry | 19 | class Entry |
17 | { | 20 | { |
21 | /** @Serializer\XmlAttribute */ | ||
18 | /** | 22 | /** |
19 | * @var integer | 23 | * @var integer |
20 | * | 24 | * |
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php index ed5cfe53..5589c039 100644 --- a/src/Wallabag/CoreBundle/Entity/User.php +++ b/src/Wallabag/CoreBundle/Entity/User.php | |||
@@ -7,6 +7,8 @@ use Doctrine\ORM\Mapping as ORM; | |||
7 | use Symfony\Component\Security\Core\User\UserInterface; | 7 | use Symfony\Component\Security\Core\User\UserInterface; |
8 | use Symfony\Component\Security\Core\User\AdvancedUserInterface; | 8 | use Symfony\Component\Security\Core\User\AdvancedUserInterface; |
9 | use Symfony\Component\Validator\Constraints as Assert; | 9 | use Symfony\Component\Validator\Constraints as Assert; |
10 | use JMS\Serializer\Annotation\ExclusionPolicy; | ||
11 | use JMS\Serializer\Annotation\Expose; | ||
10 | 12 | ||
11 | /** | 13 | /** |
12 | * User | 14 | * User |
@@ -14,12 +16,14 @@ use Symfony\Component\Validator\Constraints as Assert; | |||
14 | * @ORM\Table(name="user") | 16 | * @ORM\Table(name="user") |
15 | * @ORM\Entity | 17 | * @ORM\Entity |
16 | * @ORM\HasLifecycleCallbacks() | 18 | * @ORM\HasLifecycleCallbacks() |
19 | * @ExclusionPolicy("all") | ||
17 | */ | 20 | */ |
18 | class User implements AdvancedUserInterface, \Serializable | 21 | class User implements AdvancedUserInterface, \Serializable |
19 | { | 22 | { |
20 | /** | 23 | /** |
21 | * @var integer | 24 | * @var integer |
22 | * | 25 | * |
26 | * @Expose | ||
23 | * @ORM\Column(name="id", type="integer") | 27 | * @ORM\Column(name="id", type="integer") |
24 | * @ORM\Id | 28 | * @ORM\Id |
25 | * @ORM\GeneratedValue(strategy="AUTO") | 29 | * @ORM\GeneratedValue(strategy="AUTO") |