]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/TaggingRule.php
Merge pull request #3011 from wallabag/2.3
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / TaggingRule.php
index 20c15258291b1b59a7eb9e6db6103195d3b93ea6..84e11e261f3657d2e6f5225b0bd5a15358bc33b9 100644 (file)
@@ -3,14 +3,14 @@
 namespace Wallabag\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
-use Symfony\Component\Validator\Constraints as Assert;
 use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert;
+use Symfony\Component\Validator\Constraints as Assert;
 
 /**
- * Config.
+ * Tagging rule.
  *
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository")
- * @ORM\Table
+ * @ORM\Table(name="`tagging_rule`")
  * @ORM\Entity
  */
 class TaggingRule
@@ -28,7 +28,11 @@ class TaggingRule
      * @var string
      *
      * @Assert\NotBlank()
-     * @RulerZAssert\ValidRule()
+     * @Assert\Length(max=255)
+     * @RulerZAssert\ValidRule(
+     *  allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"},
+     *  allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"}
+     * )
      * @ORM\Column(name="rule", type="string", nullable=false)
      */
     private $rule;
@@ -83,7 +87,7 @@ class TaggingRule
     /**
      * Set tags.
      *
-     * @param array<string> $tags
+     * @param array <string> $tags
      *
      * @return TaggingRule
      */