The following worked in a previous version but after upgrading to the latest to fix the security issue, I got an issue.
I will first start with the setup:
When I execute the following code
I expect "3" as output. But I get "1".
There seems to be an issue with the metadata or the used fieldname in the _gatherRowData in the AbstractHydrator.
The following is a dump of $classMetadata = $this->_em->getClassMetadata($this->_rsm->aliasMap[$cache[$key]['dqlAlias']]);
$fieldName = $this->_rsm->metaMappings[$key]; is "fooID" or "barID"
After assigning $cache[$key]['isIdentifier'] = $classMetadata->isIdentifier($fieldName); you get false back.
So you check for fooID / barID in the array
what of course is false because they aren't in the array.
When I set the flag $cache[$key]['isIdentifier'] to true for the 2 fields, I get an output of 3 as expected.
So the fieldname is wrong or the identifier list is wrong.