Open
Description
BC Break Report
Q | A |
---|---|
BC Break | yes |
Version | 2.19.6 -> 2.19.7 |
Summary
Native query being passed entities as parameters no longer works.
Previous behavior
If you passed an entity or array of entities as parameters to a native query the conversion to primary keys would automatically be taken care of by Doctrine.
Current behavior
Doctrine doesn't surface an error the entities are passed to PDO as objects which then tries to cast them to the appropriate type.
How to reproduce
$query = $this->em->createNativeQuery($sql, $rsm);
$query->setParameter('contacts', $contacts, ArrayParameterType::INTEGER);
$query->execute();
Results in:
Warning: Object of class Contact could not be converted to int
Metadata
Metadata
Assignees
Labels
No labels