X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FTag.php;fp=src%2FWallabag%2FCoreBundle%2FEntity%2FTag.php;h=f6c42f5d72eb65f02f7152b9870214218702bf4e;hb=12c697562e11bed4d2c2af0521a67219dd62ee63;hp=a6e2d023b8b008ef14da4ac396a917adab1f8820;hpb=9b57bac8b9ad95d1b4de051222b0f351991997f0;p=github%2Fwallabag%2Fwallabag.git 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; + } }