namespace Wallabag\CoreBundle\Entity;
+use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
* Config.
*
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
- * @ORM\Table
+ * @ORM\Table(name="`config`")
* @ORM\Entity
*/
class Config
*/
private $user;
+ /**
+ * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
+ * @ORM\OrderBy({"id" = "ASC"})
+ */
+ private $taggingRules;
+
/*
* @param User $user
*/
- public function __construct(Wallabag\UserBundle\Entity\User $user)
+ public function __construct(\Wallabag\UserBundle\Entity\User $user)
{
$this->user = $user;
+ $this->taggingRules = new ArrayCollection();
}
/**
*
* @return Config
*/
- public function setUser(User $user = null)
+ public function setUser(\Wallabag\UserBundle\Entity\User $user = null)
{
$this->user = $user;
{
return $this->rssLimit;
}
+
+ /**
+ * @param TaggingRule $rule
+ *
+ * @return Config
+ */
+ public function addTaggingRule(TaggingRule $rule)
+ {
+ $this->taggingRules[] = $rule;
+
+ return $this;
+ }
+
+ /**
+ * @return ArrayCollection<TaggingRule>
+ */
+ public function getTaggingRules()
+ {
+ return $this->taggingRules;
+ }
}