|
@@ -44,16 +44,19 @@ class TagRepository extends EntityRepository
|
44
|
44
|
public function getTagsForElementSearch($ids)
|
45
|
45
|
{
|
46
|
46
|
$tags = array();
|
47
|
|
- foreach ($this->getEntityManager()
|
48
|
|
- ->createQuery('
|
49
|
|
- SELECT t.id, t.name FROM MuzichCoreBundle:Tag t
|
50
|
|
- WHERE t.id IN (:ids)
|
51
|
|
- ORDER BY t.name ASC'
|
52
|
|
- )
|
53
|
|
- ->setParameter('ids', $ids)
|
54
|
|
- ->getArrayResult() as $tag)
|
55
|
|
- {
|
56
|
|
- $tags[$tag['id']] = $tag['name'];
|
|
47
|
+ if (count($ids))
|
|
48
|
+ {
|
|
49
|
+ foreach ($this->getEntityManager()
|
|
50
|
+ ->createQuery('
|
|
51
|
+ SELECT t.id, t.name FROM MuzichCoreBundle:Tag t
|
|
52
|
+ WHERE t.id IN (:ids)
|
|
53
|
+ ORDER BY t.name ASC'
|
|
54
|
+ )
|
|
55
|
+ ->setParameter('ids', $ids)
|
|
56
|
+ ->getArrayResult() as $tag)
|
|
57
|
+ {
|
|
58
|
+ $tags[$tag['id']] = $tag['name'];
|
|
59
|
+ }
|
57
|
60
|
}
|
58
|
61
|
|
59
|
62
|
return $tags;
|