I have two tables. First table contain offer details and second table contains offer collection of languages(collection can be selected in main offer form). I want to use query with "join" language table to get all of them in single query. How it's look like: Relation
Trying to get all of the offers I want to get all offer languages as one field.
array [
'id' => string '11',
'name' => string '134',
'date' => string '01-12-2016',
'languages' => array(all language value from related table)
]
Here is my query:
$select = $this->getDbTable()->select()
->setIntegrityCheck(false)
->from(array('o' => 'offers'), array('o.*'))
->joinLeft(array('ol' => 'offer_language'), 'ol.id_offer = o.id', array('ol.*'));
$resultSet = $this->getDbTable()->fetchAll($select)
In that way if one offer has a three language then I get three same offer with different language field.
Zend Version: 1.11
Thanks for help.