1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Merge pull request #1545 from wallabag/v2-user-tag

v2 – Remove user reference in tag
This commit is contained in:
Nicolas Lœuillet 2016-01-02 12:46:52 +01:00
commit dad1c546a5
13 changed files with 159 additions and 103 deletions

View file

@ -13,7 +13,6 @@ use JMS\Serializer\Annotation\Expose;
use FOS\UserBundle\Model\User as BaseUser;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
/**
* User.
@ -69,11 +68,6 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
*/
protected $config;
/**
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\Tag", mappedBy="user", cascade={"remove"})
*/
protected $tags;
/**
* @ORM\Column(type="integer", nullable=true)
*/
@ -94,7 +88,6 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
{
parent::__construct();
$this->entries = new ArrayCollection();
$this->tags = new ArrayCollection();
$this->roles = array('ROLE_USER');
}
@ -171,26 +164,6 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
return $this->entries;
}
/**
* @param Entry $entry
*
* @return User
*/
public function addTag(Tag $tag)
{
$this->tags[] = $tag;
return $this;
}
/**
* @return ArrayCollection<Tag>
*/
public function getTags()
{
return $this->tags;
}
public function isEqualTo(UserInterface $user)
{
return $this->username === $user->getUsername();