aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Config.php
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2019-06-23 22:13:06 +0200
committerKevin Decherf <kevin@kdecherf.com>2020-04-25 15:59:23 +0200
commitc675bd11c66e60a1976dfd66484448dcc9d80f0f (patch)
tree609a1b8d355365ccf83b70bf5df6b140bb86e196 /src/Wallabag/CoreBundle/Entity/Config.php
parent8a8a78a64c116caf81aaa4339906298bdc0e32e0 (diff)
downloadwallabag-c675bd11c66e60a1976dfd66484448dcc9d80f0f.tar.gz
wallabag-c675bd11c66e60a1976dfd66484448dcc9d80f0f.tar.zst
wallabag-c675bd11c66e60a1976dfd66484448dcc9d80f0f.zip
Add IgnoreOriginRule-related entities, db migration, update config
Add IgnoreOriginUserRule for user-defined rules and IgnoreOriginInstanceRule for system-wide rules. Add an interface for these two new entities. Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Config.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index fe7942ee..1bed4513 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -119,6 +119,12 @@ class Config
119 */ 119 */
120 private $taggingRules; 120 private $taggingRules;
121 121
122 /**
123 * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
124 * @ORM\OrderBy({"id" = "ASC"})
125 */
126 private $ignoreOriginRules;
127
122 /* 128 /*
123 * @param User $user 129 * @param User $user
124 */ 130 */
@@ -126,6 +132,7 @@ class Config
126 { 132 {
127 $this->user = $user; 133 $this->user = $user;
128 $this->taggingRules = new ArrayCollection(); 134 $this->taggingRules = new ArrayCollection();
135 $this->ignoreOriginRules = new ArrayCollection();
129 } 136 }
130 137
131 /** 138 /**
@@ -387,4 +394,22 @@ class Config
387 { 394 {
388 return $this->taggingRules; 395 return $this->taggingRules;
389 } 396 }
397
398 /**
399 * @return Config
400 */
401 public function addIgnoreOriginRule(IgnoreOriginUserRule $rule)
402 {
403 $this->ignoreOriginRules[] = $rule;
404
405 return $this;
406 }
407
408 /**
409 * @return ArrayCollection<IgnoreOriginUserRule>
410 */
411 public function getIgnoreOriginRules()
412 {
413 return $this->ignoreOriginRules;
414 }
390} 415}