From 12c697562e11bed4d2c2af0521a67219dd62ee63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 3 May 2016 21:12:40 +0200 Subject: Fix number of entries in tag/list Fix #2006 --- src/Wallabag/CoreBundle/Entity/Tag.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Wallabag/CoreBundle/Entity') diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index a6e2d023..f6c42f5d 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -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; + } } -- cgit v1.2.3