I'm trying to load all of the associated entries to another table that has a foreign key
protected function _getLoadSelect($field, $value, $object)
{
$field = $this->getConnection()->quoteIdentifier(sprintf('%s.%s', $this->getMainTable(), $field));
$select = $this->getConnection()->select()->from($this->getMainTable())->where($field . '=?', $value)
->join(
['second_table_alias' => 'second_table'],
'first_table.entity_id = second_table_alias.entity_id'
)
->group('second_table_alias.entity_id');
return $select;
}
There are multiple rows that share that entity_id
and if I switch between left join and join (inner join) it returns different results.
Is it possible to get an array of all rows with that entity_id
from the secondary table? What am I doing wrong?