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>
This commit is contained in:
Kevin Decherf
2019-06-23 22:13:06 +02:00
parent 8a8a78a64c
commit c675bd11c6
10 changed files with 302 additions and 1 deletions

View File

@ -119,6 +119,12 @@ class Config
*/
private $taggingRules;
/**
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
* @ORM\OrderBy({"id" = "ASC"})
*/
private $ignoreOriginRules;
/*
* @param User $user
*/
@ -126,6 +132,7 @@ class Config
{
$this->user = $user;
$this->taggingRules = new ArrayCollection();
$this->ignoreOriginRules = new ArrayCollection();
}
/**
@ -387,4 +394,22 @@ class Config
{
return $this->taggingRules;
}
/**
* @return Config
*/
public function addIgnoreOriginRule(IgnoreOriginUserRule $rule)
{
$this->ignoreOriginRules[] = $rule;
return $this;
}
/**
* @return ArrayCollection<IgnoreOriginUserRule>
*/
public function getIgnoreOriginRules()
{
return $this->ignoreOriginRules;
}
}