X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FConfig.php;h=d3590f35f0945495ef6f07697ebb83a96afe44e1;hb=365a38984e32d152ec0170991a61bf704756cf1e;hp=2390bfe17fbc89d9de8aff5305337a0e1589dd37;hpb=16dabc326311f084d671be188c7941bbb3c341c9;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 2390bfe1..d3590f35 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 @@ -76,12 +78,19 @@ class 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(\Wallabag\UserBundle\Entity\User $user) + public function __construct(User $user) { $this->user = $user; + $this->taggingRules = new ArrayCollection(); } /** @@ -217,7 +226,7 @@ class Config /** * Set rssLimit. * - * @param string $rssLimit + * @param int $rssLimit * * @return Config */ @@ -231,10 +240,30 @@ class Config /** * Get rssLimit. * - * @return string + * @return int */ public function getRssLimit() { return $this->rssLimit; } + + /** + * @param TaggingRule $rule + * + * @return Config + */ + public function addTaggingRule(TaggingRule $rule) + { + $this->taggingRules[] = $rule; + + return $this; + } + + /** + * @return ArrayCollection + */ + public function getTaggingRules() + { + return $this->taggingRules; + } }