diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/IgnoreOriginUserRule.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/IgnoreOriginUserRule.php | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/IgnoreOriginUserRule.php b/src/Wallabag/CoreBundle/Entity/IgnoreOriginUserRule.php new file mode 100644 index 00000000..0b6f318d --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/IgnoreOriginUserRule.php | |||
@@ -0,0 +1,97 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Entity; | ||
4 | |||
5 | use Doctrine\ORM\Mapping as ORM; | ||
6 | use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; | ||
7 | use Symfony\Component\Validator\Constraints as Assert; | ||
8 | |||
9 | /** | ||
10 | * Ignore Origin rule. | ||
11 | * | ||
12 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository") | ||
13 | * @ORM\Table(name="`ignore_origin_user_rule`") | ||
14 | */ | ||
15 | class IgnoreOriginUserRule 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 | * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="ignoreOriginRules") | ||
41 | */ | ||
42 | private $config; | ||
43 | |||
44 | /** | ||
45 | * Get id. | ||
46 | * | ||
47 | * @return int | ||
48 | */ | ||
49 | public function getId() | ||
50 | { | ||
51 | return $this->id; | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * Set rule. | ||
56 | * | ||
57 | * @return IgnoreOriginRuleInterface | ||
58 | */ | ||
59 | public function setRule(string $rule) | ||
60 | { | ||
61 | $this->rule = $rule; | ||
62 | |||
63 | return $this; | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * Get rule. | ||
68 | * | ||
69 | * @return string | ||
70 | */ | ||
71 | public function getRule() | ||
72 | { | ||
73 | return $this->rule; | ||
74 | } | ||
75 | |||
76 | /** | ||
77 | * Set config. | ||
78 | * | ||
79 | * @return IgnoreOriginUserRule | ||
80 | */ | ||
81 | public function setConfig(Config $config) | ||
82 | { | ||
83 | $this->config = $config; | ||
84 | |||
85 | return $this; | ||
86 | } | ||
87 | |||
88 | /** | ||
89 | * Get config. | ||
90 | * | ||
91 | * @return Config | ||
92 | */ | ||
93 | public function getConfig() | ||
94 | { | ||
95 | return $this->config; | ||
96 | } | ||
97 | } | ||