diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Tag.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index a6e2d023..b4adbbd3 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php | |||
@@ -117,4 +117,16 @@ class Tag | |||
117 | { | 117 | { |
118 | return $this->entries; | 118 | return $this->entries; |
119 | } | 119 | } |
120 | |||
121 | public function getEntriesByUserId($userId) | ||
122 | { | ||
123 | $filteredEntries = new ArrayCollection(); | ||
124 | foreach ($this->entries as $entry) { | ||
125 | if ($entry->getUser()->getId() === $userId) { | ||
126 | $filteredEntries->add($entry); | ||
127 | } | ||
128 | } | ||
129 | |||
130 | return $filteredEntries; | ||
131 | } | ||
120 | } | 132 | } |