]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Tag.php
changed table name for tagging rule
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Tag.php
index 6f005314f69fd8e33a2e253a0d135bf74913171c..7cc452fd7f97b860f4eabadeaf9523ec95e4e5bd 100644 (file)
@@ -12,7 +12,7 @@ use Doctrine\Common\Collections\ArrayCollection;
  * Tag.
  *
  * @XmlRoot("tag")
- * @ORM\Table
+ * @ORM\Table(name="`tag`")
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
  * @ExclusionPolicy("all")
  */
@@ -42,11 +42,11 @@ class Tag
     private $entries;
 
     /**
-     * @ORM\ManyToOne(targetEntity="User", inversedBy="tags")
+     * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="tags")
      */
     private $user;
 
-    public function __construct(User $user)
+    public function __construct(\Wallabag\UserBundle\Entity\User $user)
     {
         $this->user = $user;
         $this->entries = new ArrayCollection();
@@ -96,6 +96,11 @@ class Tag
         $this->entries[] = $entry;
     }
 
+    public function hasEntry($entry)
+    {
+        return $this->entries->contains($entry);
+    }
+
     /**
      * @return User
      */