]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Entity/TaggingRule.php
Add TaggingRule entity
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / TaggingRule.php
CommitLineData
ac9fec61
KG
1<?php
2
3namespace Wallabag\CoreBundle\Entity;
4
5use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Validator\Constraints as Assert;
7
8/**
9 * Config.
10 *
11 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository")
12 * @ORM\Table
13 * @ORM\Entity
14 */
15class TaggingRule
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 * @ORM\Column(name="rule", type="string", nullable=false)
31 */
32 private $rule;
33
34 /**
35 * @var array
36 *
37 * @Assert\NotBlank()
38 * @ORM\Column(name="tags", type="simple_array", nullable=false)
39 */
40 private $tags = [];
41
42 /**
43 * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules")
44 */
45 private $config;
46
47 /**
48 * Get id.
49 *
50 * @return int
51 */
52 public function getId()
53 {
54 return $this->id;
55 }
56
57 /**
58 * Set rule.
59 *
60 * @param string $rule
61 *
62 * @return TaggingRule
63 */
64 public function setRule($rule)
65 {
66 $this->rule = $rule;
67
68 return $this;
69 }
70
71 /**
72 * Get rule.
73 *
74 * @return string
75 */
76 public function getRule()
77 {
78 return $this->rule;
79 }
80
81 /**
82 * Set tags.
83 *
84 * @param array<string> $tags
85 *
86 * @return TaggingRule
87 */
88 public function setTags(array $tags)
89 {
90 $this->tags = $tags;
91
92 return $this;
93 }
94
95 /**
96 * Get tags.
97 *
98 * @return array<string>
99 */
100 public function getTags()
101 {
102 return $this->tags;
103 }
104
105 /**
106 * Set config.
107 *
108 * @param Config $config
109 *
110 * @return TaggingRule
111 */
112 public function setConfig(Config $config)
113 {
114 $this->config = $config;
115
116 return $this;
117 }
118
119 /**
120 * Get config.
121 *
122 * @return Config
123 */
124 public function getConfig()
125 {
126 return $this->config;
127 }
128}