X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FEntity%2FTag.php;h=b4adbbd3eeffdb1e5ee774aa0027cac3d91475e2;hb=f54de6817ea320e6d92bea368123b2fb1395d95f;hp=a6e2d023b8b008ef14da4ac396a917adab1f8820;hpb=06c190887fd38c314db8d240ab2e46f5777ed59e;p=github%2Fwallabag%2Fwallabag.git 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 { 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; + } }