Answer the question
In order to leave comments, you need to log in
How to work with Doctrine ObjectManager in the same way as with SQL query with JOIN? ZF2?
Hello.
Let's say there are 2 tables. There are news and there are categories. To get a response like this:
id_новости имя_категории название_новости текст_новости дата_создания_новости
select n.id, c.name, n.title, n.text, n.created from News as n inner join Category as c on c.id = n.category_id
$news = $objectManager
->getRepository('\News\Entity\NewsItem')
->findBy(array(), array('created' => 'DESC'));
id_новости, id_категории, заголовок, текст, дата_создания_новости
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question