I'm trying to custom select use this code
$result = $qb->select('partial user.{id,name}')
->from('User', 'user')
->leftJoin('user.group', 'group')
->getQuery()
->getResult();
the result of this code in below
{
"id": 10,
"name": "admin",
"description": null,
"create_date": null,
"modified_date": null,
}
why returned field not selected with null value?!
Using the DQL "partial" keyword is not enough to get a partial entity as a result.
The DQL hint HINT_FORCE_PARTIAL_LOAD must be used as well.