forked from wallabag/wallabag
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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user