- $tags = [];
-
- foreach (explode(',', $tagsLabels) as $tagLabel) {
- $tagEntity = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($tagLabel);
-
- if (!empty($tagEntity)) {
- $tags[] = $tagEntity;
- }
- }
+ $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());