X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FConfig.php;h=c6e65d66e050cb4c977b059da3c727ad5ead5b81;hb=92a66835624acf6fd14f5adc5f8aab399658592e;hp=1204efa85aba14de91c90f0efb49d5ebb616fa68;hpb=1d7b350b259ccc0110318a377ae3b3752ec6b9fb;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 1204efa8..c6e65d66 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; +use Wallabag\UserBundle\Entity\User; /** * Config. @@ -15,6 +16,9 @@ use Symfony\Component\Validator\Constraints as Assert; */ class Config { + const REDIRECT_TO_HOMEPAGE = 0; + const REDIRECT_TO_CURRENT_PAGE = 1; + /** * @var int * @@ -39,7 +43,7 @@ class Config * @Assert\Range( * min = 1, * max = 100000, - * maxMessage = "This will certainly kill the app" + * maxMessage = "validator.item_per_page_too_high" * ) * @ORM\Column(name="items_per_page", type="integer", nullable=false) */ @@ -56,21 +60,49 @@ class Config /** * @var string * - * @ORM\Column(name="rss_token", type="string", nullable=true) + * @ORM\Column(name="feed_token", type="string", nullable=true) */ - private $rssToken; + private $feedToken; /** * @var int * - * @ORM\Column(name="rss_limit", type="integer", nullable=true) + * @ORM\Column(name="feed_limit", type="integer", nullable=true) * @Assert\Range( * min = 1, * max = 100000, - * maxMessage = "This will certainly kill the app" + * maxMessage = "validator.feed_limit_too_high" * ) */ - private $rssLimit; + private $feedLimit; + + /** + * @var float + * + * @ORM\Column(name="reading_speed", type="float", nullable=true) + */ + private $readingSpeed; + + /** + * @var string + * + * @ORM\Column(name="pocket_consumer_key", type="string", nullable=true) + */ + private $pocketConsumerKey; + + /** + * @var int + * + * @ORM\Column(name="action_mark_as_read", type="integer", nullable=true, options={"default" = 0}) + */ + private $actionMarkAsRead; + + /** + * @var int + * + * @ORM\Column(name="list_mode", type="integer", nullable=true) + */ + private $listMode; /** * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") @@ -79,13 +111,14 @@ class Config /** * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"}) + * @ORM\OrderBy({"id" = "ASC"}) */ private $taggingRules; /* * @param User $user */ - public function __construct(\Wallabag\UserBundle\Entity\User $user) + public function __construct(User $user) { $this->user = $user; $this->taggingRules = new ArrayCollection(); @@ -180,7 +213,7 @@ class Config * * @return Config */ - public function setUser(\Wallabag\UserBundle\Entity\User $user = null) + public function setUser(User $user = null) { $this->user = $user; @@ -198,51 +231,139 @@ class Config } /** - * Set rssToken. + * Set feed Token. * - * @param string $rssToken + * @param string $feedToken * * @return Config */ - public function setRssToken($rssToken) + public function setFeedToken($feedToken) { - $this->rssToken = $rssToken; + $this->feedToken = $feedToken; return $this; } /** - * Get rssToken. + * Get feedToken. * * @return string */ - public function getRssToken() + public function getFeedToken() + { + return $this->feedToken; + } + + /** + * Set Feed Limit. + * + * @param int $feedLimit + * + * @return Config + */ + public function setFeedLimit($feedLimit) { - return $this->rssToken; + $this->feedLimit = $feedLimit; + + return $this; } /** - * Set rssLimit. + * Get Feed Limit. * - * @param string $rssLimit + * @return int + */ + public function getFeedLimit() + { + return $this->feedLimit; + } + + /** + * Set readingSpeed. + * + * @param float $readingSpeed * * @return Config */ - public function setRssLimit($rssLimit) + public function setReadingSpeed($readingSpeed) { - $this->rssLimit = $rssLimit; + $this->readingSpeed = $readingSpeed; return $this; } /** - * Get rssLimit. + * Get readingSpeed. + * + * @return float + */ + public function getReadingSpeed() + { + return $this->readingSpeed; + } + + /** + * Set pocketConsumerKey. + * + * @param string $pocketConsumerKey + * + * @return Config + */ + public function setPocketConsumerKey($pocketConsumerKey) + { + $this->pocketConsumerKey = $pocketConsumerKey; + + return $this; + } + + /** + * Get pocketConsumerKey. * * @return string */ - public function getRssLimit() + public function getPocketConsumerKey() { - return $this->rssLimit; + return $this->pocketConsumerKey; + } + + /** + * @return int + */ + public function getActionMarkAsRead() + { + return $this->actionMarkAsRead; + } + + /** + * @param int $actionMarkAsRead + * + * @return Config + */ + public function setActionMarkAsRead($actionMarkAsRead) + { + $this->actionMarkAsRead = $actionMarkAsRead; + + return $this; + } + + /** + * @return int + */ + public function getListMode() + { + return $this->listMode; + } + + /** + * @param int $listMode + * + * @return Config + */ + public function setListMode($listMode) + { + $this->listMode = $listMode; + + return $this; } /**