]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Tag.php
Merge pull request #1369 from wallabag/v2-bottombar
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Tag.php
index 29a5e4b5eb69e1b2b07ef1bb49608afce7469e7a..92442df6ddb00ad823f43bc53f0c534d6be0760a 100644 (file)
@@ -9,17 +9,17 @@ use JMS\Serializer\Annotation\Expose;
 use Doctrine\Common\Collections\ArrayCollection;
 
 /**
- * Tag
+ * Tag.
  *
  * @XmlRoot("tag")
- * @ORM\Table(name="tag")
+ * @ORM\Table
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
  * @ExclusionPolicy("all")
  */
 class Tag
 {
     /**
-     * @var integer
+     * @var int
      *
      * @Expose
      * @ORM\Column(name="id", type="integer")
@@ -51,10 +51,16 @@ class Tag
         $this->user    = $user;
         $this->entries = new ArrayCollection();
     }
+
+    public function __toString()
+    {
+        return $this->label;
+    }
+
     /**
-     * Get id
+     * Get id.
      *
-     * @return integer
+     * @return int
      */
     public function getId()
     {
@@ -62,9 +68,10 @@ class Tag
     }
 
     /**
-     * Set label
+     * Set label.
+     *
+     * @param string $label
      *
-     * @param  string $label
      * @return Tag
      */
     public function setLabel($label)
@@ -75,7 +82,7 @@ class Tag
     }
 
     /**
-     * Get label
+     * Get label.
      *
      * @return string
      */
@@ -88,4 +95,12 @@ class Tag
     {
         $this->entries[] = $entry;
     }
+
+    /**
+     * @return User
+     */
+    public function getUser()
+    {
+        return $this->user;
+    }
 }