diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Tag.php | 17 |
2 files changed, 3 insertions, 16 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 2813c944..b413c489 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -465,7 +465,7 @@ class Entry | |||
465 | // check if tag already exist but has not yet be persisted | 465 | // check if tag already exist but has not yet be persisted |
466 | // it seems that the previous condition with `contains()` doesn't check that case | 466 | // it seems that the previous condition with `contains()` doesn't check that case |
467 | foreach ($this->tags as $existingTag) { | 467 | foreach ($this->tags as $existingTag) { |
468 | if ($existingTag->getUser() !== $tag->getUser() || $existingTag->getLabel() === $tag->getLabel()) { | 468 | if ($existingTag->getLabel() === $tag->getLabel()) { |
469 | return; | 469 | return; |
470 | } | 470 | } |
471 | } | 471 | } |
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 4ed588be..0689c7b3 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php | |||
@@ -38,6 +38,7 @@ class Tag | |||
38 | private $label; | 38 | private $label; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * @Expose | ||
41 | * @Gedmo\Slug(fields={"label"}) | 42 | * @Gedmo\Slug(fields={"label"}) |
42 | * @ORM\Column(length=128, unique=true) | 43 | * @ORM\Column(length=128, unique=true) |
43 | */ | 44 | */ |
@@ -48,14 +49,8 @@ class Tag | |||
48 | */ | 49 | */ |
49 | private $entries; | 50 | private $entries; |
50 | 51 | ||
51 | /** | 52 | public function __construct() |
52 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="tags") | ||
53 | */ | ||
54 | private $user; | ||
55 | |||
56 | public function __construct(\Wallabag\UserBundle\Entity\User $user) | ||
57 | { | 53 | { |
58 | $this->user = $user; | ||
59 | $this->entries = new ArrayCollection(); | 54 | $this->entries = new ArrayCollection(); |
60 | } | 55 | } |
61 | 56 | ||
@@ -112,12 +107,4 @@ class Tag | |||
112 | { | 107 | { |
113 | return $this->entries->contains($entry); | 108 | return $this->entries->contains($entry); |
114 | } | 109 | } |
115 | |||
116 | /** | ||
117 | * @return User | ||
118 | */ | ||
119 | public function getUser() | ||
120 | { | ||
121 | return $this->user; | ||
122 | } | ||
123 | } | 110 | } |