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;
86 * @ORM\Column(name="pocket_consumer_key", type="string", nullable=true)
88 private $pocketConsumerKey;
91 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
96 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
97 * @ORM\OrderBy({"id" = "ASC"})
99 private $taggingRules;
104 public function __construct(User
$user)
107 $this->taggingRules
= new ArrayCollection();
115 public function getId()
123 * @param string $theme
127 public function setTheme($theme)
129 $this->theme
= $theme;
139 public function getTheme()
147 * @param int $itemsPerPage
151 public function setItemsPerPage($itemsPerPage)
153 $this->itemsPerPage
= $itemsPerPage;
163 public function getItemsPerPage()
165 return $this->itemsPerPage
;
171 * @param string $language
175 public function setLanguage($language)
177 $this->language
= $language;
187 public function getLanguage()
189 return $this->language
;
199 public function setUser(User
$user = null)
211 public function getUser()
219 * @param string $rssToken
223 public function setRssToken($rssToken)
225 $this->rssToken
= $rssToken;
235 public function getRssToken()
237 return $this->rssToken
;
243 * @param int $rssLimit
247 public function setRssLimit($rssLimit)
249 $this->rssLimit
= $rssLimit;
259 public function getRssLimit()
261 return $this->rssLimit
;
267 * @param float $readingSpeed
271 public function setReadingSpeed($readingSpeed)
273 $this->readingSpeed
= $readingSpeed;
283 public function getReadingSpeed()
285 return $this->readingSpeed
;
289 * Set pocketConsumerKey.
291 * @param string $pocketConsumerKey
295 public function setPocketConsumerKey($pocketConsumerKey)
297 $this->pocketConsumerKey
= $pocketConsumerKey;
303 * Get pocketConsumerKey.
307 public function getPocketConsumerKey()
309 return $this->pocketConsumerKey
;
313 * @param TaggingRule $rule
317 public function addTaggingRule(TaggingRule
$rule)
319 $this->taggingRules
[] = $rule;
325 * @return ArrayCollection<TaggingRule>
327 public function getTaggingRules()
329 return $this->taggingRules
;