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