mirror of
https://github.com/wallabag/wallabag.git
synced 2025-10-10 19:32:07 +00:00
parent
c997cfcc9c
commit
fc73222723
13 changed files with 123 additions and 99 deletions
|
@ -465,7 +465,7 @@ class Entry
|
|||
// check if tag already exist but has not yet be persisted
|
||||
// it seems that the previous condition with `contains()` doesn't check that case
|
||||
foreach ($this->tags as $existingTag) {
|
||||
if ($existingTag->getUser() !== $tag->getUser() || $existingTag->getLabel() === $tag->getLabel()) {
|
||||
if ($existingTag->getLabel() === $tag->getLabel()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class Tag
|
|||
private $label;
|
||||
|
||||
/**
|
||||
* @Expose
|
||||
* @Gedmo\Slug(fields={"label"})
|
||||
* @ORM\Column(length=128, unique=true)
|
||||
*/
|
||||
|
@ -48,14 +49,8 @@ class Tag
|
|||
*/
|
||||
private $entries;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="tags")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
public function __construct(\Wallabag\UserBundle\Entity\User $user)
|
||||
public function __construct()
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->entries = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
@ -112,12 +107,4 @@ class Tag
|
|||
{
|
||||
return $this->entries->contains($entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue