aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php
diff options
context:
space:
mode:
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}