3 namespace Wallabag\CoreBundle\Entity
;
5 use Doctrine\ORM\Mapping
as ORM
;
6 use JMS\Serializer\Annotation\Exclude
;
7 use JMS\Serializer\Annotation\Groups
;
8 use JMS\Serializer\Annotation\XmlRoot
;
9 use Symfony\Bridge\RulerZ\Validator\Constraints
as RulerZAssert
;
10 use Symfony\Component\Validator\Constraints
as Assert
;
15 * @XmlRoot("tagging_rule")
16 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository")
17 * @ORM\Table(name="`tagging_rule`")
20 class TaggingRule
implements RuleInterface
25 * @ORM\Column(name="id", type="integer")
27 * @ORM\GeneratedValue(strategy="AUTO")
35 * @Assert\Length(max=255)
36 * @RulerZAssert\ValidRule(
37 * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"},
38 * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"}
40 * @ORM\Column(name="rule", type="string", nullable=false)
42 * @Groups({"export_tagging_rule"})
50 * @ORM\Column(name="tags", type="simple_array", nullable=false)
52 * @Groups({"export_tagging_rule"})
59 * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules")
68 public function getId()
80 public function setRule($rule)
92 public function getRule()
100 * @param array <string> $tags
102 * @return TaggingRule
104 public function setTags(array $tags)
114 * @return array<string>
116 public function getTags()
124 * @return TaggingRule
126 public function setConfig(Config
$config)
128 $this->config
= $config;
138 public function getConfig()
140 return $this->config
;