Hi,
I found a problem using orm. When I try to use select manager and join another table in response I don't get any columns from join expression.
I found a problem using orm. When I try to use select manager and join another table in response I don't get any columns from join expression.
PHP Code:
$entityManager = $this->getEntityManager();
try {
$test = $entityManager->getRepository('ProcessedDeclaration')
->select(['id', 'name', 'date', 'wasteMass', 'servicedBy', 'route.status', 'account.servicedBy']) // if I skip this, I receive full ProcessedDeclaration object without joined tables columns
->join([['Account', 'account', ['account.id:' => 'id']]])
->join([['Route', 'route', ['route.id:' => 'route_id']]])
->join([['WasteTransferCard', 'wtc', ['wtc.id:' => 'waste_transfer_card_id']]])
->join([['Legal,', 'l', ['l.id:' => 'account.current_legal_id']]]) // tried to name columns in camel case and snake case, the same results
->join([['Driver', 'd', ['d.id:' => 'route.driver_route_id']]])
->where([
'AND' => [
'wasteMass>' => 0,
'status' => [
"Processed"
]
]
])
->groupBy('id')
->limit(0, 1)
->find();
var_dump($test->toArray());
} catch (\Exception $e) {
var_dump($e->getMessage());
}
Comment