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;
103 * @ORM\Column(name="list_mode", type="integer", nullable=true)
108 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
113 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
114 * @ORM\OrderBy({"id" = "ASC"})
116 private $taggingRules;
121 public function __construct(User
$user)
124 $this->taggingRules
= new ArrayCollection();
132 public function getId()
140 * @param string $theme
144 public function setTheme($theme)
146 $this->theme
= $theme;
156 public function getTheme()
164 * @param int $itemsPerPage
168 public function setItemsPerPage($itemsPerPage)
170 $this->itemsPerPage
= $itemsPerPage;
180 public function getItemsPerPage()
182 return $this->itemsPerPage
;
188 * @param string $language
192 public function setLanguage($language)
194 $this->language
= $language;
204 public function getLanguage()
206 return $this->language
;
216 public function setUser(User
$user = null)
228 public function getUser()
236 * @param string $rssToken
240 public function setRssToken($rssToken)
242 $this->rssToken
= $rssToken;
252 public function getRssToken()
254 return $this->rssToken
;
260 * @param int $rssLimit
264 public function setRssLimit($rssLimit)
266 $this->rssLimit
= $rssLimit;
276 public function getRssLimit()
278 return $this->rssLimit
;
284 * @param float $readingSpeed
288 public function setReadingSpeed($readingSpeed)
290 $this->readingSpeed
= $readingSpeed;
300 public function getReadingSpeed()
302 return $this->readingSpeed
;
306 * Set pocketConsumerKey.
308 * @param string $pocketConsumerKey
312 public function setPocketConsumerKey($pocketConsumerKey)
314 $this->pocketConsumerKey
= $pocketConsumerKey;
320 * Get pocketConsumerKey.
324 public function getPocketConsumerKey()
326 return $this->pocketConsumerKey
;
332 public function getActionMarkAsRead()
334 return $this->actionMarkAsRead
;
338 * @param int $actionMarkAsRead
342 public function setActionMarkAsRead($actionMarkAsRead)
344 $this->actionMarkAsRead
= $actionMarkAsRead;
352 public function getListMode()
354 return $this->listMode
;
358 * @param int $listMode
362 public function setListMode($listMode)
364 $this->listMode
= $listMode;
370 * @param TaggingRule $rule
374 public function addTaggingRule(TaggingRule
$rule)
376 $this->taggingRules
[] = $rule;
382 * @return ArrayCollection<TaggingRule>
384 public function getTaggingRules()
386 return $this->taggingRules
;