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`")
19 const REDIRECT_TO_HOMEPAGE
= 0;
20 const REDIRECT_TO_CURRENT_PAGE
= 1;
25 * @ORM\Column(name="id", type="integer")
27 * @ORM\GeneratedValue(strategy="AUTO")
35 * @ORM\Column(name="theme", type="string", nullable=false)
46 * maxMessage = "validator.item_per_page_too_high"
48 * @ORM\Column(name="items_per_page", type="integer", nullable=false)
50 private $itemsPerPage;
56 * @ORM\Column(name="language", type="string", nullable=false)
63 * @ORM\Column(name="rss_token", type="string", nullable=true)
70 * @ORM\Column(name="rss_limit", type="integer", nullable=true)
74 * maxMessage = "validator.rss_limit_too_high"
82 * @ORM\Column(name="reading_speed", type="float", nullable=true)
84 private $readingSpeed;
89 * @ORM\Column(name="pocket_consumer_key", type="string", nullable=true)
91 private $pocketConsumerKey;
96 * @ORM\Column(name="action_mark_as_read", type="integer", nullable=true)
98 private $actionMarkAsRead;
101 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
106 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
107 * @ORM\OrderBy({"id" = "ASC"})
109 private $taggingRules;
114 public function __construct(User
$user)
117 $this->taggingRules
= new ArrayCollection();
125 public function getId()
133 * @param string $theme
137 public function setTheme($theme)
139 $this->theme
= $theme;
149 public function getTheme()
157 * @param int $itemsPerPage
161 public function setItemsPerPage($itemsPerPage)
163 $this->itemsPerPage
= $itemsPerPage;
173 public function getItemsPerPage()
175 return $this->itemsPerPage
;
181 * @param string $language
185 public function setLanguage($language)
187 $this->language
= $language;
197 public function getLanguage()
199 return $this->language
;
209 public function setUser(User
$user = null)
221 public function getUser()
229 * @param string $rssToken
233 public function setRssToken($rssToken)
235 $this->rssToken
= $rssToken;
245 public function getRssToken()
247 return $this->rssToken
;
253 * @param int $rssLimit
257 public function setRssLimit($rssLimit)
259 $this->rssLimit
= $rssLimit;
269 public function getRssLimit()
271 return $this->rssLimit
;
277 * @param float $readingSpeed
281 public function setReadingSpeed($readingSpeed)
283 $this->readingSpeed
= $readingSpeed;
293 public function getReadingSpeed()
295 return $this->readingSpeed
;
299 * Set pocketConsumerKey.
301 * @param string $pocketConsumerKey
305 public function setPocketConsumerKey($pocketConsumerKey)
307 $this->pocketConsumerKey
= $pocketConsumerKey;
313 * Get pocketConsumerKey.
317 public function getPocketConsumerKey()
319 return $this->pocketConsumerKey
;
325 public function getActionMarkAsRead()
327 return $this->actionMarkAsRead
;
331 * @param int $actionMarkAsRead
335 public function setActionMarkAsRead($actionMarkAsRead)
337 $this->actionMarkAsRead
= $actionMarkAsRead;
343 * @param TaggingRule $rule
347 public function addTaggingRule(TaggingRule
$rule)
349 $this->taggingRules
[] = $rule;
355 * @return ArrayCollection<TaggingRule>
357 public function getTaggingRules()
359 return $this->taggingRules
;