aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2016-01-02 12:46:52 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2016-01-02 12:46:52 +0100
commitdad1c546a521159ca65a5a7649651d37728f0e55 (patch)
treef1d59eb83b45adb83bb21726374133a399d3c740 /src/Wallabag/CoreBundle/Entity
parent5432f6150939af6e7d2e8bf0faea0576491aaed0 (diff)
parent6be9750155fa731d75898b4973a126a090345c2d (diff)
downloadwallabag-dad1c546a521159ca65a5a7649651d37728f0e55.tar.gz
wallabag-dad1c546a521159ca65a5a7649651d37728f0e55.tar.zst
wallabag-dad1c546a521159ca65a5a7649651d37728f0e55.zip
Merge pull request #1545 from wallabag/v2-user-tag
v2 – Remove user reference in tag
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php2
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tag.php17
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}