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
+ * Config.
*
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
- * @ORM\Table(name="config")
+ * @ORM\Table(name="`config`")
* @ORM\Entity
*/
class Config
{
/**
- * @var integer
+ * @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
private $theme;
/**
- * @var integer
+ * @var int
*
* @Assert\NotBlank()
* @Assert\Range(
private $rssToken;
/**
- * @var integer
+ * @var int
*
* @ORM\Column(name="rss_limit", type="integer", nullable=true)
* @Assert\Range(
private $rssLimit;
/**
- * @ORM\OneToOne(targetEntity="User", inversedBy="config")
+ * @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(User $user)
{
$this->user = $user;
+ $this->taggingRules = new ArrayCollection();
}
/**
- * Get id
+ * Get id.
*
- * @return integer
+ * @return int
*/
public function getId()
{
}
/**
- * Set theme
+ * Set theme.
+ *
+ * @param string $theme
*
- * @param string $theme
* @return Config
*/
public function setTheme($theme)
}
/**
- * Get theme
+ * Get theme.
*
* @return string
*/
}
/**
- * Set itemsPerPage
+ * Set itemsPerPage.
+ *
+ * @param int $itemsPerPage
*
- * @param integer $itemsPerPage
* @return Config
*/
public function setItemsPerPage($itemsPerPage)
}
/**
- * Get itemsPerPage
+ * Get itemsPerPage.
*
- * @return integer
+ * @return int
*/
public function getItemsPerPage()
{
}
/**
- * Set language
+ * Set language.
+ *
+ * @param string $language
*
- * @param string $language
* @return Config
*/
public function setLanguage($language)
}
/**
- * Get language
+ * Get language.
*
* @return string
*/
}
/**
- * Set user
+ * Set user.
+ *
+ * @param User $user
*
- * @param \Wallabag\CoreBundle\Entity\User $user
* @return Config
*/
- public function setUser(\Wallabag\CoreBundle\Entity\User $user = null)
+ public function setUser(User $user = null)
{
$this->user = $user;
}
/**
- * Get user
+ * Get user.
*
- * @return \Wallabag\CoreBundle\Entity\User
+ * @return User
*/
public function getUser()
{
}
/**
- * Set rssToken
+ * Set rssToken.
+ *
+ * @param string $rssToken
*
- * @param string $rssToken
* @return Config
*/
public function setRssToken($rssToken)
}
/**
- * Get rssToken
+ * Get rssToken.
*
* @return string
*/
}
/**
- * Set rssLimit
+ * Set rssLimit.
+ *
+ * @param int $rssLimit
*
- * @param string $rssLimit
* @return Config
*/
public function setRssLimit($rssLimit)
}
/**
- * Get rssLimit
+ * Get rssLimit.
*
- * @return string
+ * @return int
*/
public function getRssLimit()
{
return $this->rssLimit;
}
+
+ /**
+ * Set readingSpeed.
+ *
+ * @param int $readingSpeed
+ *
+ * @return Config
+ */
+ public function setReadingSpeed($readingSpeed)
+ {
+ $this->readingSpeed = $readingSpeed;
+
+ return $this;
+ }
+
+ /**
+ * Get readingSpeed.
+ *
+ * @return int
+ */
+ 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;
+ }
}