diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php | 71 |
1 files changed, 71 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..34aed50c --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/IgnoreOriginInstanceRule.php | |||
@@ -0,0 +1,71 @@ | |||
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\IgnoreOriginInstanceRuleRepository") | ||
13 | * @ORM\Table(name="`ignore_origin_instance_rule`") | ||
14 | * @ORM\Entity | ||
15 | */ | ||
16 | class IgnoreOriginInstanceRule implements IgnoreOriginRuleInterface, RuleInterface | ||
17 | { | ||
18 | /** | ||
19 | * @var int | ||
20 | * | ||
21 | * @ORM\Column(name="id", type="integer") | ||
22 | * @ORM\Id | ||
23 | * @ORM\GeneratedValue(strategy="AUTO") | ||
24 | */ | ||
25 | private $id; | ||
26 | |||
27 | /** | ||
28 | * @var string | ||
29 | * | ||
30 | * @Assert\NotBlank() | ||
31 | * @Assert\Length(max=255) | ||
32 | * @RulerZAssert\ValidRule( | ||
33 | * allowed_variables={"host","pattern"}, | ||
34 | * allowed_operators={"=","~"} | ||
35 | * ) | ||
36 | * @ORM\Column(name="rule", type="string", nullable=false) | ||
37 | */ | ||
38 | private $rule; | ||
39 | |||
40 | /** | ||
41 | * Get id. | ||
42 | * | ||
43 | * @return int | ||
44 | */ | ||
45 | public function getId() | ||
46 | { | ||
47 | return $this->id; | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * Set rule. | ||
52 | * | ||
53 | * @return IgnoreOriginRuleInterface | ||
54 | */ | ||
55 | public function setRule(string $rule) | ||
56 | { | ||
57 | $this->rule = $rule; | ||
58 | |||
59 | return $this; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * Get rule. | ||
64 | * | ||
65 | * @return string | ||
66 | */ | ||
67 | public function getRule() | ||
68 | { | ||
69 | return $this->rule; | ||
70 | } | ||
71 | } | ||