aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Config.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Config.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php28
1 files changed, 28 insertions, 0 deletions
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 @@
2 2
3namespace Wallabag\CoreBundle\Entity; 3namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\Common\Collections\ArrayCollection;
5use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Validator\Constraints as Assert; 7use Symfony\Component\Validator\Constraints as Assert;
7 8
@@ -76,12 +77,19 @@ class Config
76 */ 77 */
77 private $user; 78 private $user;
78 79
80 /**
81 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
82 * @ORM\OrderBy({"id" = "ASC"})
83 */
84 private $taggingRules;
85
79 /* 86 /*
80 * @param User $user 87 * @param User $user
81 */ 88 */
82 public function __construct(\Wallabag\UserBundle\Entity\User $user) 89 public function __construct(\Wallabag\UserBundle\Entity\User $user)
83 { 90 {
84 $this->user = $user; 91 $this->user = $user;
92 $this->taggingRules = new ArrayCollection();
85 } 93 }
86 94
87 /** 95 /**
@@ -237,4 +245,24 @@ class Config
237 { 245 {
238 return $this->rssLimit; 246 return $this->rssLimit;
239 } 247 }
248
249 /**
250 * @param TaggingRule $rule
251 *
252 * @return Config
253 */
254 public function addTaggingRule(TaggingRule $rule)
255 {
256 $this->taggingRules[] = $rule;
257
258 return $this;
259 }
260
261 /**
262 * @return ArrayCollection<TaggingRule>
263 */
264 public function getTaggingRules()
265 {
266 return $this->taggingRules;
267 }
240} 268}