I have Entity tag [ id , title ] and Entity annonce [id, title] .
Tag and annonce in relation ManyToMany,
So i have assiciation annonce_tag [ annonce_id, tag_id ]
I have only repository tag and repository annonce, i dont have annonce_tag repository
and i want to make query to get the TOP for example 3 tags most used
Who has suggestions to make this query
/---------Updated----------/
I have tried this one in Tag Repository but not working
return $query = $this->createQueryBuilder('t')
->select('t.id','count(a)')
->innerJoin('t.annonces', 'a')
->getQuery()->getResult();