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")
17 * @ORM\Index(name="config_feed_token", columns={"feed_token"}, options={"lengths"={255}}),
23 const REDIRECT_TO_HOMEPAGE
= 0;
24 const REDIRECT_TO_CURRENT_PAGE
= 1;
29 * @ORM\Column(name="id", type="integer")
31 * @ORM\GeneratedValue(strategy="AUTO")
39 * @ORM\Column(name="theme", type="string", nullable=false)
50 * maxMessage = "validator.item_per_page_too_high"
52 * @ORM\Column(name="items_per_page", type="integer", nullable=false)
54 private $itemsPerPage;
60 * @ORM\Column(name="language", type="string", nullable=false)
67 * @ORM\Column(name="feed_token", type="string", nullable=true)
74 * @ORM\Column(name="feed_limit", type="integer", nullable=true)
78 * maxMessage = "validator.feed_limit_too_high"
86 * @ORM\Column(name="reading_speed", type="float", nullable=true)
88 private $readingSpeed;
93 * @ORM\Column(name="pocket_consumer_key", type="string", nullable=true)
95 private $pocketConsumerKey;
100 * @ORM\Column(name="action_mark_as_read", type="integer", nullable=true, options={"default" = 0})
102 private $actionMarkAsRead;
107 * @ORM\Column(name="list_mode", type="integer", nullable=true)
112 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
117 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
118 * @ORM\OrderBy({"id" = "ASC"})
120 private $taggingRules;
123 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
124 * @ORM\OrderBy({"id" = "ASC"})
126 private $ignoreOriginRules;
131 public function __construct(User
$user)
134 $this->taggingRules
= new ArrayCollection();
135 $this->ignoreOriginRules
= new ArrayCollection();
143 public function getId()
151 * @param string $theme
155 public function setTheme($theme)
157 $this->theme
= $theme;
167 public function getTheme()
175 * @param int $itemsPerPage
179 public function setItemsPerPage($itemsPerPage)
181 $this->itemsPerPage
= $itemsPerPage;
191 public function getItemsPerPage()
193 return $this->itemsPerPage
;
199 * @param string $language
203 public function setLanguage($language)
205 $this->language
= $language;
215 public function getLanguage()
217 return $this->language
;
227 public function setUser(User
$user = null)
239 public function getUser()
247 * @param string $feedToken
251 public function setFeedToken($feedToken)
253 $this->feedToken
= $feedToken;
263 public function getFeedToken()
265 return $this->feedToken
;
271 * @param int $feedLimit
275 public function setFeedLimit($feedLimit)
277 $this->feedLimit
= $feedLimit;
287 public function getFeedLimit()
289 return $this->feedLimit
;
295 * @param float $readingSpeed
299 public function setReadingSpeed($readingSpeed)
301 $this->readingSpeed
= $readingSpeed;
311 public function getReadingSpeed()
313 return $this->readingSpeed
;
317 * Set pocketConsumerKey.
319 * @param string $pocketConsumerKey
323 public function setPocketConsumerKey($pocketConsumerKey)
325 $this->pocketConsumerKey
= $pocketConsumerKey;
331 * Get pocketConsumerKey.
335 public function getPocketConsumerKey()
337 return $this->pocketConsumerKey
;
343 public function getActionMarkAsRead()
345 return $this->actionMarkAsRead
;
349 * @param int $actionMarkAsRead
353 public function setActionMarkAsRead($actionMarkAsRead)
355 $this->actionMarkAsRead
= $actionMarkAsRead;
363 public function getListMode()
365 return $this->listMode
;
369 * @param int $listMode
373 public function setListMode($listMode)
375 $this->listMode
= $listMode;
383 public function addTaggingRule(TaggingRule
$rule)
385 $this->taggingRules
[] = $rule;
391 * @return ArrayCollection<TaggingRule>
393 public function getTaggingRules()
395 return $this->taggingRules
;
401 public function addIgnoreOriginRule(IgnoreOriginUserRule
$rule)
403 $this->ignoreOriginRules
[] = $rule;
409 * @return ArrayCollection<IgnoreOriginUserRule>
411 public function getIgnoreOriginRules()
413 return $this->ignoreOriginRules
;