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;
93 * @ORM\Column(name="action_mark_as_read", type="integer", nullable=true)
95 private $actionMarkAsRead;
98 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
103 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
104 * @ORM\OrderBy({"id" = "ASC"})
106 private $taggingRules;
111 public function __construct(User
$user)
114 $this->taggingRules
= new ArrayCollection();
122 public function getId()
130 * @param string $theme
134 public function setTheme($theme)
136 $this->theme
= $theme;
146 public function getTheme()
154 * @param int $itemsPerPage
158 public function setItemsPerPage($itemsPerPage)
160 $this->itemsPerPage
= $itemsPerPage;
170 public function getItemsPerPage()
172 return $this->itemsPerPage
;
178 * @param string $language
182 public function setLanguage($language)
184 $this->language
= $language;
194 public function getLanguage()
196 return $this->language
;
206 public function setUser(User
$user = null)
218 public function getUser()
226 * @param string $rssToken
230 public function setRssToken($rssToken)
232 $this->rssToken
= $rssToken;
242 public function getRssToken()
244 return $this->rssToken
;
250 * @param int $rssLimit
254 public function setRssLimit($rssLimit)
256 $this->rssLimit
= $rssLimit;
266 public function getRssLimit()
268 return $this->rssLimit
;
274 * @param float $readingSpeed
278 public function setReadingSpeed($readingSpeed)
280 $this->readingSpeed
= $readingSpeed;
290 public function getReadingSpeed()
292 return $this->readingSpeed
;
296 * Set pocketConsumerKey.
298 * @param string $pocketConsumerKey
302 public function setPocketConsumerKey($pocketConsumerKey)
304 $this->pocketConsumerKey
= $pocketConsumerKey;
310 * Get pocketConsumerKey.
314 public function getPocketConsumerKey()
316 return $this->pocketConsumerKey
;
322 public function getActionMarkAsRead()
324 return $this->actionMarkAsRead
;
328 * @param int $actionMarkAsRead
332 public function setActionMarkAsRead($actionMarkAsRead)
334 $this->actionMarkAsRead
= $actionMarkAsRead;
340 * @param TaggingRule $rule
344 public function addTaggingRule(TaggingRule
$rule)
346 $this->taggingRules
[] = $rule;
352 * @return ArrayCollection<TaggingRule>
354 public function getTaggingRules()
356 return $this->taggingRules
;