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