X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FConfig.php;h=d0f0e3f38809dc00331327a1f6e9706fcd405572;hb=637aa17e6b52dd8021854a809053560a27caca72;hp=025d94efb605ee9ff1be2e1f86cadacb536d2d87;hpb=2878416f8b4d94fb5e64c2fa61861526a7654d3d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 025d94ef..d0f0e3f3 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -2,14 +2,16 @@ 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. * * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository") - * @ORM\Table + * @ORM\Table(name="`config`") * @ORM\Entity */ class Config @@ -38,7 +40,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) */ @@ -66,22 +68,43 @@ class Config * @Assert\Range( * min = 1, * max = 100000, - * maxMessage = "This will certainly kill the app" + * maxMessage = "validator.rss_limit_too_hight" * ) */ private $rssLimit; /** - * @ORM\OneToOne(targetEntity="User", inversedBy="config") + * @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; + + /** + * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") */ private $user; + /** + * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"}) + * @ORM\OrderBy({"id" = "ASC"}) + */ + private $taggingRules; + /* * @param User $user */ public function __construct(User $user) { $this->user = $user; + $this->taggingRules = new ArrayCollection(); } /** @@ -169,11 +192,11 @@ class Config /** * Set user. * - * @param \Wallabag\CoreBundle\Entity\User $user + * @param User $user * * @return Config */ - public function setUser(\Wallabag\CoreBundle\Entity\User $user = null) + public function setUser(User $user = null) { $this->user = $user; @@ -183,7 +206,7 @@ class Config /** * Get user. * - * @return \Wallabag\CoreBundle\Entity\User + * @return User */ public function getUser() { @@ -217,7 +240,7 @@ class Config /** * Set rssLimit. * - * @param string $rssLimit + * @param int $rssLimit * * @return Config */ @@ -231,10 +254,78 @@ class Config /** * Get rssLimit. * - * @return string + * @return int */ public function getRssLimit() { return $this->rssLimit; } + + /** + * Set readingSpeed. + * + * @param float $readingSpeed + * + * @return Config + */ + public function setReadingSpeed($readingSpeed) + { + $this->readingSpeed = $readingSpeed; + + return $this; + } + + /** + * 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 getPocketConsumerKey() + { + return $this->pocketConsumerKey; + } + + /** + * @param TaggingRule $rule + * + * @return Config + */ + public function addTaggingRule(TaggingRule $rule) + { + $this->taggingRules[] = $rule; + + return $this; + } + + /** + * @return ArrayCollection + */ + public function getTaggingRules() + { + return $this->taggingRules; + } }