symfony - Doctrine 2, Getting the last n articles for each category -
I have 2 entities, articles and categories, which have many links owned by the article, and I want the last 4 Get articles for each category.
If I was working with MySQL, the solution would be here, but unfortunately I am working with DOCTRINE2 and DQL, I really do not know how to translate into two queries < / P>
"text">
If working with language language or question builder is your You can write your pure question and call it in your repository category:
public Nkshn fetchSomeRecordFromMyTable () {$ sql = 'My net MYSQl QUERY'; $ Connection = $ this- & gt; GetEntityManager () - & gt; Mill Connection () - & gt; Ready ($ sql); $ Connection & gt; Executed (); Return $ connection- & gt; Get all (\ PDO :: FETCH_ASSOC); }
Comments
Post a Comment