X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FConfig.php;h=2ca4182e6700da790f8f6f02e1fa44701bbee1ed;hb=fc73222723c7a0c9b577805d3ef51eb96b124b92;hp=b2a1915a4fdbd22f921e5ecae5212da9ff922d46;hpb=f1eccfd63f214dcc730ab0d18a694a5465f425db;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index b2a1915a..2ca4182e 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -2,6 +2,7 @@ namespace Wallabag\CoreBundle\Entity; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; @@ -76,12 +77,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) { $this->user = $user; + $this->taggingRules = new ArrayCollection(); } /** @@ -237,4 +245,24 @@ class Config { 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; + } }