]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/TaggingRule.php
Merge pull request #1583 from wallabag/v2-fix-delete
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / TaggingRule.php
index 6d03a34da7b3257548533377caaca4d493fc522d..28914cc1949efb94ec3cb59fe688f6e1cd4a5da8 100644 (file)
@@ -3,13 +3,14 @@
 namespace Wallabag\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
+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
@@ -27,6 +28,10 @@ class TaggingRule
      * @var string
      *
      * @Assert\NotBlank()
+     * @RulerZAssert\ValidRule(
+     *  allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"},
+     *  allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches"}
+     * )
      * @ORM\Column(name="rule", type="string", nullable=false)
      */
     private $rule;