aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2019-06-26 22:31:47 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-07-08 09:38:32 +0200
commit34be2d5de44ade2a78be73decc0b90a2c1bca720 (patch)
treed635438784c4b02e1d182cfbc3d47b62e5032f1d /src/Wallabag/CoreBundle/Entity
parent92cd51aa2c29e23f137cde9b9732ced33ff38e59 (diff)
downloadwallabag-34be2d5de44ade2a78be73decc0b90a2c1bca720.tar.gz
wallabag-34be2d5de44ade2a78be73decc0b90a2c1bca720.tar.zst
wallabag-34be2d5de44ade2a78be73decc0b90a2c1bca720.zip
Add ability to import/export tagging rules
- Add missing translations - Add some tests - Add `/api/taggingrule/export` API endpoint - Add baggy theme - Add error message when importing tagging rules failed - Also fix all translations (I think we are good now)
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/TaggingRule.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
index c1be3165..eac53fa3 100644
--- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php
+++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
@@ -3,12 +3,16 @@
3namespace Wallabag\CoreBundle\Entity; 3namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use JMS\Serializer\Annotation\Exclude;
7use JMS\Serializer\Annotation\Groups;
8use JMS\Serializer\Annotation\XmlRoot;
6use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; 9use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
7use Symfony\Component\Validator\Constraints as Assert; 10use 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;