]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Tag.php
Merge pull request #1804 from wallabag/j0k3r-patch-1
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Tag.php
index 4ed588be867be0a3b38227dce42b863999721bee..a6e2d023b8b008ef14da4ac396a917adab1f8820 100644 (file)
@@ -2,12 +2,12 @@
 
 namespace Wallabag\CoreBundle\Entity;
 
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\ORM\Mapping as ORM;
-use JMS\Serializer\Annotation\XmlRoot;
 use JMS\Serializer\Annotation\ExclusionPolicy;
 use JMS\Serializer\Annotation\Expose;
-use Doctrine\Common\Collections\ArrayCollection;
 use Gedmo\Mapping\Annotation as Gedmo;
+use JMS\Serializer\Annotation\XmlRoot;
 
 /**
  * Tag.
@@ -38,6 +38,7 @@ class Tag
     private $label;
 
     /**
+     * @Expose
      * @Gedmo\Slug(fields={"label"})
      * @ORM\Column(length=128, unique=true)
      */
@@ -48,14 +49,8 @@ class Tag
      */
     private $entries;
 
-    /**
-     * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="tags")
-     */
-    private $user;
-
-    public function __construct(\Wallabag\UserBundle\Entity\User $user)
+    public function __construct()
     {
-        $this->user = $user;
         $this->entries = new ArrayCollection();
     }
 
@@ -114,10 +109,12 @@ class Tag
     }
 
     /**
-     * @return User
+     * Get entries for this tag.
+     *
+     * @return ArrayCollection<Entry>
      */
-    public function getUser()
+    public function getEntries()
     {
-        return $this->user;
+        return $this->entries;
     }
 }