diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2016-01-02 12:46:52 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2016-01-02 12:46:52 +0100 |
commit | dad1c546a521159ca65a5a7649651d37728f0e55 (patch) | |
tree | f1d59eb83b45adb83bb21726374133a399d3c740 /src/Wallabag/CoreBundle/Helper | |
parent | 5432f6150939af6e7d2e8bf0faea0576491aaed0 (diff) | |
parent | 6be9750155fa731d75898b4973a126a090345c2d (diff) | |
download | wallabag-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/Helper')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php index 41ef25b8..991c9a56 100644 --- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php +++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php | |||
@@ -37,7 +37,7 @@ class RuleBasedTagger | |||
37 | } | 37 | } |
38 | 38 | ||
39 | foreach ($rule->getTags() as $label) { | 39 | foreach ($rule->getTags() as $label) { |
40 | $tag = $this->getTag($entry->getUser(), $label); | 40 | $tag = $this->getTag($label); |
41 | 41 | ||
42 | $entry->addTag($tag); | 42 | $entry->addTag($tag); |
43 | } | 43 | } |
@@ -62,7 +62,7 @@ class RuleBasedTagger | |||
62 | 62 | ||
63 | foreach ($entries as $entry) { | 63 | foreach ($entries as $entry) { |
64 | foreach ($rule->getTags() as $label) { | 64 | foreach ($rule->getTags() as $label) { |
65 | $tag = $this->getTag($user, $label); | 65 | $tag = $this->getTag($label); |
66 | 66 | ||
67 | $entry->addTag($tag); | 67 | $entry->addTag($tag); |
68 | } | 68 | } |
@@ -73,19 +73,18 @@ class RuleBasedTagger | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * Fetch a tag for a user. | 76 | * Fetch a tag. |
77 | * | 77 | * |
78 | * @param User $user | ||
79 | * @param string $label The tag's label. | 78 | * @param string $label The tag's label. |
80 | * | 79 | * |
81 | * @return Tag | 80 | * @return Tag |
82 | */ | 81 | */ |
83 | private function getTag(User $user, $label) | 82 | private function getTag($label) |
84 | { | 83 | { |
85 | $tag = $this->tagRepository->findOneByLabelAndUserId($label, $user->getId()); | 84 | $tag = $this->tagRepository->findOneByLabel($label); |
86 | 85 | ||
87 | if (!$tag) { | 86 | if (!$tag) { |
88 | $tag = new Tag($user); | 87 | $tag = new Tag(); |
89 | $tag->setLabel($label); | 88 | $tag->setLabel($label); |
90 | } | 89 | } |
91 | 90 | ||