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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -