]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Config.php
Fix tag related test for Pocket
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Config.php
index 2390bfe17fbc89d9de8aff5305337a0e1589dd37..2ca4182e6700da790f8f6f02e1fa44701bbee1ed 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Wallabag\CoreBundle\Entity;
 
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\ORM\Mapping as ORM;
 use Symfony\Component\Validator\Constraints as Assert;
 
@@ -9,7 +10,7 @@ use Symfony\Component\Validator\Constraints as Assert;
  * Config.
  *
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
- * @ORM\Table
+ * @ORM\Table(name="`config`")
  * @ORM\Entity
  */
 class Config
@@ -76,12 +77,19 @@ class Config
      */
     private $user;
 
+    /**
+     * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
+     * @ORM\OrderBy({"id" = "ASC"})
+     */
+    private $taggingRules;
+
     /*
      * @param User     $user
      */
     public function __construct(\Wallabag\UserBundle\Entity\User $user)
     {
         $this->user = $user;
+        $this->taggingRules = new ArrayCollection();
     }
 
     /**
@@ -173,7 +181,7 @@ class Config
      *
      * @return Config
      */
-    public function setUser(User $user = null)
+    public function setUser(\Wallabag\UserBundle\Entity\User $user = null)
     {
         $this->user = $user;
 
@@ -237,4 +245,24 @@ class Config
     {
         return $this->rssLimit;
     }
+
+    /**
+     * @param TaggingRule $rule
+     *
+     * @return Config
+     */
+    public function addTaggingRule(TaggingRule $rule)
+    {
+        $this->taggingRules[] = $rule;
+
+        return $this;
+    }
+
+    /**
+     * @return ArrayCollection<TaggingRule>
+     */
+    public function getTaggingRules()
+    {
+        return $this->taggingRules;
+    }
 }