]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Tag.php
Merge pull request #1164 from wallabag/v2-remove-username-in-config
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Tag.php
index 5aed1fa010008727e3550a6763f710d291ec212f..9d3c7a32105327cceccadecc0f74711d6d09c3ff 100644 (file)
@@ -12,7 +12,7 @@ use Doctrine\Common\Collections\ArrayCollection;
  * Tag
  *
  * @XmlRoot("tag")
- * @ORM\Table(name="tag")
+ * @ORM\Table
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
  * @ExclusionPolicy("all")
  */
@@ -41,8 +41,14 @@ class Tag
      */
     private $entries;
 
-    public function __construct()
+    /**
+     * @ORM\ManyToOne(targetEntity="User", inversedBy="tags")
+     */
+    private $user;
+
+    public function __construct(User $user)
     {
+        $this->user    = $user;
         $this->entries = new ArrayCollection();
     }
     /**
@@ -82,4 +88,12 @@ class Tag
     {
         $this->entries[] = $entry;
     }
+
+    /**
+     * @return User
+     */
+    public function getUser()
+    {
+        return $this->user;
+    }
 }