private function buildJoinColumn(&$select, &$join, EntityField &$entityField, Entity $parentEntity) { $entityTbl = "moldp_" . $entityField->getJoinColumn()->getTableName(); $select .= "," . $this->appendTableToEntityFields($entityField->getJoinColumn()) . " "; $join .= " LEFT JOIN " . $entityField->getJoinColumn()->getTableName() . " AS " . $entityTbl . " ON " . $entityTbl . ".id ="; $join .= " moldp_" . $parentEntity->getTableName() . "." . $entityField->getColumnName(); foreach ($entityField->getJoinColumn()->getEntityFields() as $key => $subEntity) { if ($subEntity->isEager()) { $this->buildEntityJoin($select, $join, $subEntity, $entityField->getJoinColumn()); } } }