$entity =
new $entityClass();
if (!
$entity instanceof Entity
) { throw new \
RuntimeException(sprintf('Expected instance of Entity.php, got %s',
$entity::
class));
} $entity->
addExtension(EntityReader::FOREIGN_KEYS,
new ArrayStruct([],
$definition->
getEntityName() . '_foreign_keys_extension'
));
$entity->
addExtension(EntityReader::INTERNAL_MAPPING_STORAGE,
new ArrayStruct());
$entity->
setUniqueIdentifier($identifier);
$entity->
internalSetEntityData($definition->
getEntityName(),
$definition->
getFieldVisibility());
$entity =
$hydrator->
assign($definition,
$entity,
$root,
$row,
$context);
return self::
$hydrated[$cacheKey] =
$entity;
}}