aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Tag.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-20 20:29:33 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-03-06 20:50:30 +0100
commit0a018fe03980b35c9f7aca838e67a8efa43b7f2d (patch)
treed531ff5c3051871dd5315e26e50ec45c7da2b16b /src/Wallabag/CoreBundle/Entity/Tag.php
parent6d37a7e6c11666c2c220c9eb358a877f15bcfa0e (diff)
downloadwallabag-0a018fe03980b35c9f7aca838e67a8efa43b7f2d.tar.gz
wallabag-0a018fe03980b35c9f7aca838e67a8efa43b7f2d.tar.zst
wallabag-0a018fe03980b35c9f7aca838e67a8efa43b7f2d.zip
add relation between entry and tag
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Tag.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tag.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php
index 0d7f8c2b..1cdf4df0 100644
--- a/src/Wallabag/CoreBundle/Entity/Tag.php
+++ b/src/Wallabag/CoreBundle/Entity/Tag.php
@@ -4,6 +4,8 @@ namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use JMS\Serializer\Annotation\XmlRoot; 6use JMS\Serializer\Annotation\XmlRoot;
7use JMS\Serializer\Annotation\ExclusionPolicy;
8use JMS\Serializer\Annotation\Expose;
7 9
8/** 10/**
9 * Tag 11 * Tag
@@ -11,12 +13,14 @@ use JMS\Serializer\Annotation\XmlRoot;
11 * @XmlRoot("tag") 13 * @XmlRoot("tag")
12 * @ORM\Table(name="tag") 14 * @ORM\Table(name="tag")
13 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository") 15 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
16 * @ExclusionPolicy("all")
14 */ 17 */
15class Tag 18class Tag
16{ 19{
17 /** 20 /**
18 * @var integer 21 * @var integer
19 * 22 *
23 * @Expose
20 * @ORM\Column(name="id", type="integer") 24 * @ORM\Column(name="id", type="integer")
21 * @ORM\Id 25 * @ORM\Id
22 * @ORM\GeneratedValue(strategy="AUTO") 26 * @ORM\GeneratedValue(strategy="AUTO")
@@ -26,11 +30,17 @@ class Tag
26 /** 30 /**
27 * @var string 31 * @var string
28 * 32 *
33 * @Expose
29 * @ORM\Column(name="label", type="text") 34 * @ORM\Column(name="label", type="text")
30 */ 35 */
31 private $label; 36 private $label;
32 37
33 /** 38 /**
39 * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist", "merge"})
40 */
41 private $entries;
42
43 /**
34 * Get id 44 * Get id
35 * 45 *
36 * @return integer 46 * @return integer