]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Tag.php
Fix number of entries in tag/list
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Tag.php
index a6e2d023b8b008ef14da4ac396a917adab1f8820..f6c42f5d72eb65f02f7152b9870214218702bf4e 100644 (file)
@@ -117,4 +117,16 @@ class Tag
     {
         return $this->entries;
     }
+
+    public function getEntriesByUser($userId)
+    {
+        $filteredEntries = new ArrayCollection();
+        foreach ($this->entries as $entry) {
+            if ($entry->getUser()->getId() === $userId) {
+                $filteredEntries->add($entry);
+            }
+        }
+
+        return $filteredEntries;
+    }
 }