Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native query being passed entities as parameters no longer works #11602

Open
cs278 opened this issue Sep 18, 2024 · 0 comments
Open

Native query being passed entities as parameters no longer works #11602

cs278 opened this issue Sep 18, 2024 · 0 comments

Comments

@cs278
Copy link

cs278 commented Sep 18, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant