3 namespace Wallabag\CoreBundle\Entity
;
5 use Doctrine\Common\Collections\ArrayCollection
;
6 use Doctrine\ORM\Mapping
as ORM
;
7 use Symfony\Component\Validator\Constraints
as Assert
;
8 use Wallabag\UserBundle\Entity\User
;
13 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
14 * @ORM\Table(name="`config`")
22 * @ORM\Column(name="id", type="integer")
24 * @ORM\GeneratedValue(strategy="AUTO")
32 * @ORM\Column(name="theme", type="string", nullable=false)
43 * maxMessage = "validator.item_per_page_too_high"
45 * @ORM\Column(name="items_per_page", type="integer", nullable=false)
47 private $itemsPerPage;
53 * @ORM\Column(name="language", type="string", nullable=false)
60 * @ORM\Column(name="rss_token", type="string", nullable=true)
67 * @ORM\Column(name="rss_limit", type="integer", nullable=true)
71 * maxMessage = "validator.rss_limit_too_hight"
79 * @ORM\Column(name="reading_speed", type="float", nullable=true)
81 private $readingSpeed;
84 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
89 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
90 * @ORM\OrderBy({"id" = "ASC"})
92 private $taggingRules;
97 public function __construct(User
$user)
100 $this->taggingRules
= new ArrayCollection();
108 public function getId()
116 * @param string $theme
120 public function setTheme($theme)
122 $this->theme
= $theme;
132 public function getTheme()
140 * @param int $itemsPerPage
144 public function setItemsPerPage($itemsPerPage)
146 $this->itemsPerPage
= $itemsPerPage;
156 public function getItemsPerPage()
158 return $this->itemsPerPage
;
164 * @param string $language
168 public function setLanguage($language)
170 $this->language
= $language;
180 public function getLanguage()
182 return $this->language
;
192 public function setUser(User
$user = null)
204 public function getUser()
212 * @param string $rssToken
216 public function setRssToken($rssToken)
218 $this->rssToken
= $rssToken;
228 public function getRssToken()
230 return $this->rssToken
;
236 * @param int $rssLimit
240 public function setRssLimit($rssLimit)
242 $this->rssLimit
= $rssLimit;
252 public function getRssLimit()
254 return $this->rssLimit
;
260 * @param float $readingSpeed
264 public function setReadingSpeed($readingSpeed)
266 $this->readingSpeed
= $readingSpeed;
276 public function getReadingSpeed()
278 return $this->readingSpeed
;
282 * @param TaggingRule $rule
286 public function addTaggingRule(TaggingRule
$rule)
288 $this->taggingRules
[] = $rule;
294 * @return ArrayCollection<TaggingRule>
296 public function getTaggingRules()
298 return $this->taggingRules
;