$projects = $this->modelsManager->createBuilder()
->from('Companies')
->rightJoin('CompToProductAdapter', 'Companies.id = CompToProductAdapter.company_id')
->rightJoin('Projects', 'Projects.id = CompToProductAdapter.project_id')
->getQuery()
->execute();
This works however I get the Companies model when I really want the Projects Model. I've tried the following below:
1.
->addFrom('Companies','c','CompToProductAdapter','a','Projects','p')
2.
->from('CompToProductAdapter ')
->from('Projects')
3.
->from(array('Projects','CompToProductAdapter','Companies'))
and many others but I can't get this to work. Any suggestions?