aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2020-04-26 15:39:57 +0200
committerGitHub <noreply@github.com>2020-04-26 15:39:57 +0200
commit0e8a0f77d0b643a884e6687bd9c463267852a970 (patch)
tree88c6761b4215637bba34b263015e87750c92a187 /src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php
parent8a8a78a64c116caf81aaa4339906298bdc0e32e0 (diff)
parent71f7e58fbd84e1d15c7a405a3c5872adb937dc37 (diff)
downloadwallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.gz
wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.zst
wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.zip
Merge pull request #4026 from wallabag/3760-ignorelist-db
Move Ignore Origin rules to database
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php b/src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php
new file mode 100644
index 00000000..ce3b6e7d
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php
@@ -0,0 +1,70 @@
1<?php
2
3namespace Wallabag\CoreBundle\Entity;
4
5use Doctrine\ORM\Mapping as ORM;
6use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
7use Symfony\Component\Validator\Constraints as Assert;
8
9/**
10 * Ignore Origin rule.
11 *
12 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository")
13 * @ORM\Table(name="`ignore_origin_instance_rule`")
14 */
15class IgnoreOriginInstanceRule implements IgnoreOriginRuleInterface, RuleInterface
16{
17 /**
18 * @var int
19 *
20 * @ORM\Column(name="id", type="integer")
21 * @ORM\Id
22 * @ORM\GeneratedValue(strategy="AUTO")
23 */
24 private $id;
25
26 /**
27 * @var string
28 *
29 * @Assert\NotBlank()
30 * @Assert\Length(max=255)
31 * @RulerZAssert\ValidRule(
32 * allowed_variables={"host","_all"},
33 * allowed_operators={"=","~"}
34 * )
35 * @ORM\Column(name="rule", type="string", nullable=false)
36 */
37 private $rule;
38
39 /**
40 * Get id.
41 *
42 * @return int
43 */
44 public function getId()
45 {
46 return $this->id;
47 }
48
49 /**
50 * Set rule.
51 *
52 * @return IgnoreOriginRuleInterface
53 */
54 public function setRule(string $rule)
55 {
56 $this->rule = $rule;
57
58 return $this;
59 }
60
61 /**
62 * Get rule.
63 *
64 * @return string
65 */
66 public function getRule()
67 {
68 return $this->rule;
69 }
70}