Doctrine Query reverse join?

BDD Schema

I have these relations.

I need to retrieve all contents but order by star.content_Idcontent first.

It works with easy SQL:

SELECT content.idcontent
FROM content
LEFT JOIN star ON content.idcontent = star.content_Idcontent 
ORDER BY star.content_Idcontent DESC,content.idcontent

But I don’t know how to do it with Doctrine because content is not the owner of the relation.

Must I create a bidirectional relation or is there a way to make it work?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *