]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Config.php
Improved tests
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Config.php
index ddd4f7d98792aa2e2581de544292b981cdea9c41..e18b543b19070c5271d1ffc9a13f05e341a6abcd 100644 (file)
@@ -2,14 +2,16 @@
 
 namespace Wallabag\CoreBundle\Entity;
 
+use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\ORM\Mapping as ORM;
 use Symfony\Component\Validator\Constraints as Assert;
+use Wallabag\UserBundle\Entity\User;
 
 /**
  * Config.
  *
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
- * @ORM\Table
+ * @ORM\Table(name="`config`")
  * @ORM\Entity
  */
 class Config
@@ -71,17 +73,31 @@ class Config
      */
     private $rssLimit;
 
+    /**
+     * @var float
+     *
+     * @ORM\Column(name="reading_speed", type="float", nullable=true)
+     */
+    private $readingSpeed;
+
     /**
      * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="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)
+    public function __construct(User $user)
     {
         $this->user = $user;
+        $this->taggingRules = new ArrayCollection();
     }
 
     /**
@@ -217,7 +233,7 @@ class Config
     /**
      * Set rssLimit.
      *
-     * @param string $rssLimit
+     * @param int $rssLimit
      *
      * @return Config
      */
@@ -231,10 +247,54 @@ class Config
     /**
      * Get rssLimit.
      *
-     * @return string
+     * @return int
      */
     public function getRssLimit()
     {
         return $this->rssLimit;
     }
+
+    /**
+     * Set readingSpeed.
+     *
+     * @param float $readingSpeed
+     *
+     * @return Config
+     */
+    public function setReadingSpeed($readingSpeed)
+    {
+        $this->readingSpeed = $readingSpeed;
+
+        return $this;
+    }
+
+    /**
+     * Get readingSpeed.
+     *
+     * @return float
+     */
+    public function getReadingSpeed()
+    {
+        return $this->readingSpeed;
+    }
+
+    /**
+     * @param TaggingRule $rule
+     *
+     * @return Config
+     */
+    public function addTaggingRule(TaggingRule $rule)
+    {
+        $this->taggingRules[] = $rule;
+
+        return $this;
+    }
+
+    /**
+     * @return ArrayCollection<TaggingRule>
+     */
+    public function getTaggingRules()
+    {
+        return $this->taggingRules;
+    }
 }