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;
125 public function __construct(User
$user)
128 $this->taggingRules
= new ArrayCollection();
136 public function getId()
144 * @param string $theme
148 public function setTheme($theme)
150 $this->theme
= $theme;
160 public function getTheme()
168 * @param int $itemsPerPage
172 public function setItemsPerPage($itemsPerPage)
174 $this->itemsPerPage
= $itemsPerPage;
184 public function getItemsPerPage()
186 return $this->itemsPerPage
;
192 * @param string $language
196 public function setLanguage($language)
198 $this->language
= $language;
208 public function getLanguage()
210 return $this->language
;
220 public function setUser(User
$user = null)
232 public function getUser()
240 * @param string $feedToken
244 public function setFeedToken($feedToken)
246 $this->feedToken
= $feedToken;
256 public function getFeedToken()
258 return $this->feedToken
;
264 * @param int $feedLimit
268 public function setFeedLimit($feedLimit)
270 $this->feedLimit
= $feedLimit;
280 public function getFeedLimit()
282 return $this->feedLimit
;
288 * @param float $readingSpeed
292 public function setReadingSpeed($readingSpeed)
294 $this->readingSpeed
= $readingSpeed;
304 public function getReadingSpeed()
306 return $this->readingSpeed
;
310 * Set pocketConsumerKey.
312 * @param string $pocketConsumerKey
316 public function setPocketConsumerKey($pocketConsumerKey)
318 $this->pocketConsumerKey
= $pocketConsumerKey;
324 * Get pocketConsumerKey.
328 public function getPocketConsumerKey()
330 return $this->pocketConsumerKey
;
336 public function getActionMarkAsRead()
338 return $this->actionMarkAsRead
;
342 * @param int $actionMarkAsRead
346 public function setActionMarkAsRead($actionMarkAsRead)
348 $this->actionMarkAsRead
= $actionMarkAsRead;
356 public function getListMode()
358 return $this->listMode
;
362 * @param int $listMode
366 public function setListMode($listMode)
368 $this->listMode
= $listMode;
376 public function addTaggingRule(TaggingRule
$rule)
378 $this->taggingRules
[] = $rule;
384 * @return ArrayCollection<TaggingRule>
386 public function getTaggingRules()
388 return $this->taggingRules
;