X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FUser.php;h=f05c8760e03e2780f5cbbf85e302f93fe2327f26;hb=092ca70725b0263390e45c46f93828c613eca3f0;hp=5589c039e754e15e8192a3498a7f6e5a17cdec87;hpb=a36737f4859e3acbddf5cfe90c279ba725a6d88a;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php index 5589c039..f05c8760 100644 --- a/src/Wallabag/CoreBundle/Entity/User.php +++ b/src/Wallabag/CoreBundle/Entity/User.php @@ -101,10 +101,17 @@ class User implements AdvancedUserInterface, \Serializable */ private $config; + /** + * @ORM\OneToMany(targetEntity="Tag", mappedBy="user", cascade={"remove"}) + */ + private $tags; + public function __construct() { - $this->salt = md5(uniqid(null, true)); - $this->entries = new ArrayCollection(); + $this->isActive = true; + $this->salt = md5(uniqid(null, true)); + $this->entries = new ArrayCollection(); + $this->tags = new ArrayCollection(); } /** @@ -278,6 +285,25 @@ class User implements AdvancedUserInterface, \Serializable return $this->entries; } + /** + * @param Entry $entry + * + * @return User + */ + public function addTag(Tag $tag) + { + $this->tags[] = $tag; + + return $this; + } + + /** + * @return ArrayCollection + */ + public function getTags() + { + return $this->tags; + } /** * @inheritDoc */