X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FConfig.php;h=62ea637eaaa4e64debd5b99262afb92b7bee477b;hb=164bd801188245942ca996eda75d7a554f29746a;hp=045ca308ee99991303ae0ecb95c3a0bc7f565cdf;hpb=4cfbd5d893aa51fd5d3b349c2695e9913591041f;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 045ca308..62ea637e 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -3,11 +3,13 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * Config * - * @ORM\Table(name="config") + * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository") + * @ORM\Table * @ORM\Entity */ class Config @@ -15,25 +17,72 @@ class Config /** * @var integer * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", type="integer") * @ORM\Id - * @ORM\GeneratedValue(strategy="IDENTITY") + * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * - * @ORM\Column(name="name", type="string", nullable=true) + * @Assert\NotBlank() + * @ORM\Column(name="theme", type="string", nullable=false) */ - private $name; + private $theme; + + /** + * @var integer + * + * @Assert\NotBlank() + * @Assert\Range( + * min = 1, + * max = 100000, + * maxMessage = "This will certainly kill the app" + * ) + * @ORM\Column(name="items_per_page", type="integer", nullable=false) + */ + private $itemsPerPage; /** * @var string * - * @ORM\Column(name="value", type="blob", nullable=true) + * @Assert\NotBlank() + * @ORM\Column(name="language", type="string", nullable=false) + */ + private $language; + + /** + * @var string + * + * @ORM\Column(name="rss_token", type="string", nullable=true) + */ + private $rssToken; + + /** + * @var integer + * + * @ORM\Column(name="rss_limit", type="integer", nullable=true) + * @Assert\Range( + * min = 1, + * max = 100000, + * maxMessage = "This will certainly kill the app" + * ) */ - private $value; + private $rssLimit; + + /** + * @ORM\OneToOne(targetEntity="User", inversedBy="config") + */ + private $user; + + /* + * @param User $user + */ + public function __construct(User $user) + { + $this->user = $user; + } /** * Get id @@ -46,48 +95,140 @@ class Config } /** - * Set name + * Set theme + * + * @param string $theme + * @return Config + */ + public function setTheme($theme) + { + $this->theme = $theme; + + return $this; + } + + /** + * Get theme + * + * @return string + */ + public function getTheme() + { + return $this->theme; + } + + /** + * Set itemsPerPage + * + * @param integer $itemsPerPage + * @return Config + */ + public function setItemsPerPage($itemsPerPage) + { + $this->itemsPerPage = $itemsPerPage; + + return $this; + } + + /** + * Get itemsPerPage + * + * @return integer + */ + public function getItemsPerPage() + { + return $this->itemsPerPage; + } + + /** + * Set language + * + * @param string $language + * @return Config + */ + public function setLanguage($language) + { + $this->language = $language; + + return $this; + } + + /** + * Get language + * + * @return string + */ + public function getLanguage() + { + return $this->language; + } + + /** + * Set user + * + * @param \Wallabag\CoreBundle\Entity\User $user + * @return Config + */ + public function setUser(\Wallabag\CoreBundle\Entity\User $user = null) + { + $this->user = $user; + + return $this; + } + + /** + * Get user + * + * @return \Wallabag\CoreBundle\Entity\User + */ + public function getUser() + { + return $this->user; + } + + /** + * Set rssToken * - * @param string $name + * @param string $rssToken * @return Config */ - public function setName($name) + public function setRssToken($rssToken) { - $this->name = $name; + $this->rssToken = $rssToken; return $this; } /** - * Get name + * Get rssToken * * @return string */ - public function getName() + public function getRssToken() { - return $this->name; + return $this->rssToken; } /** - * Set value + * Set rssLimit * - * @param string $value + * @param string $rssLimit * @return Config */ - public function setValue($value) + public function setRssLimit($rssLimit) { - $this->value = $value; + $this->rssLimit = $rssLimit; return $this; } /** - * Get value + * Get rssLimit * * @return string */ - public function getValue() + public function getRssLimit() { - return $this->value; + return $this->rssLimit; } }