diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/TaggingRule.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/TaggingRule.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index 84e11e26..f7166087 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php | |||
@@ -3,12 +3,16 @@ | |||
3 | namespace Wallabag\CoreBundle\Entity; | 3 | namespace Wallabag\CoreBundle\Entity; |
4 | 4 | ||
5 | use Doctrine\ORM\Mapping as ORM; | 5 | use Doctrine\ORM\Mapping as ORM; |
6 | use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert; | 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; | ||
7 | use Symfony\Component\Validator\Constraints as Assert; | 10 | use Symfony\Component\Validator\Constraints as Assert; |
8 | 11 | ||
9 | /** | 12 | /** |
10 | * Tagging rule. | 13 | * Tagging rule. |
11 | * | 14 | * |
15 | * @XmlRoot("tagging_rule") | ||
12 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository") | 16 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository") |
13 | * @ORM\Table(name="`tagging_rule`") | 17 | * @ORM\Table(name="`tagging_rule`") |
14 | * @ORM\Entity | 18 | * @ORM\Entity |
@@ -34,6 +38,8 @@ class TaggingRule | |||
34 | * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"} | 38 | * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"} |
35 | * ) | 39 | * ) |
36 | * @ORM\Column(name="rule", type="string", nullable=false) | 40 | * @ORM\Column(name="rule", type="string", nullable=false) |
41 | * | ||
42 | * @Groups({"export_tagging_rule"}) | ||
37 | */ | 43 | */ |
38 | private $rule; | 44 | private $rule; |
39 | 45 | ||
@@ -42,10 +48,14 @@ class TaggingRule | |||
42 | * | 48 | * |
43 | * @Assert\NotBlank() | 49 | * @Assert\NotBlank() |
44 | * @ORM\Column(name="tags", type="simple_array", nullable=false) | 50 | * @ORM\Column(name="tags", type="simple_array", nullable=false) |
51 | * | ||
52 | * @Groups({"export_tagging_rule"}) | ||
45 | */ | 53 | */ |
46 | private $tags = []; | 54 | private $tags = []; |
47 | 55 | ||
48 | /** | 56 | /** |
57 | * @Exclude | ||
58 | * | ||
49 | * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules") | 59 | * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules") |
50 | */ | 60 | */ |
51 | private $config; | 61 | private $config; |
@@ -111,8 +121,6 @@ class TaggingRule | |||
111 | /** | 121 | /** |
112 | * Set config. | 122 | * Set config. |
113 | * | 123 | * |
114 | * @param Config $config | ||
115 | * | ||
116 | * @return TaggingRule | 124 | * @return TaggingRule |
117 | */ | 125 | */ |
118 | public function setConfig(Config $config) | 126 | public function setConfig(Config $config) |