- foreach ($tags as $key => $tag) {
- $nbEntries = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Entry')
- ->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag['id']);
+ foreach ($tags as $tag) {
+ $nbEntries = $repository->countAllEntriesByUserIdAndTagId(
+ $this->getUser()->getId(),
+ $tag->getId()
+ );