]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Tag.php
Merge pull request #1392 from wallabag/v2-fix-redirect
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Tag.php
index afe9e1b9af22a8d4263d29a9728afa641ca0c894..97c4579f70e8c1a607817a28ca5985912a2c8b3d 100644 (file)
@@ -48,9 +48,15 @@ class Tag
 
     public function __construct(User $user)
     {
-        $this->user    = $user;
+        $this->user = $user;
         $this->entries = new ArrayCollection();
     }
+
+    public function __toString()
+    {
+        return $this->label;
+    }
+
     /**
      * Get id.
      *
@@ -90,6 +96,11 @@ class Tag
         $this->entries[] = $entry;
     }
 
+    public function hasEntry($entry)
+    {
+        return $this->entries->contains($entry);
+    }
+
     /**
      * @return User
      */