mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
findBy does not accept array anymore #6311
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JKoty on GitHub (Sep 26, 2019).
Originally assigned to: @JKoty on GitHub.
Bug Report
Summary
Using
findBywith array generated SQLrelatedEntity.id IN (Related\Entity\Full\Namespace(<id>), Related\Entity\Full\Namespace(<id2>))instead of justrelatedEntity.id IN (<id>, <id2>)Current behavior
How to reproduce
see above
Expected behavior
result contains related entity
@jaikdean commented on GitHub (Sep 26, 2019):
Possibly related to #7830
@SenseException commented on GitHub (Sep 29, 2019):
Let's keep this issue open until it is sure that there is a relation to the mentioned bug.
@lcobucci commented on GitHub (Oct 1, 2019):
@JKoty I've tried to reproduce this issue in a functional test but failed miserably. Would please take a look at the sample test case to see what I've missed and send us PR with a failing test?
Sample test case
@JKoty commented on GitHub (Oct 2, 2019):
@lcobucci
Here you have.
Failing test case
I have to correct myself, it's not really in findBy. I had facade over it which I did not notice. But I have done some digging and found out its in
$typeparameter of->setParameter()method. So it is probably same issue as in #7830I also had to add
__toStringmethod to entity.@lcobucci commented on GitHub (Oct 2, 2019):
@JKoty thanks! I'm not sure if using
ParameterType::STRING + Connection::ARRAY_PARAM_OFFSETas type is actually supported and documented. How did you find this solution?@JKoty commented on GitHub (Oct 2, 2019):
@lcobucci Actually it's from package kdyby/doctrine (here), line 74) so I'm not sure why is it even there. Maybe it should be fixed in their package. Dunno.
@beberlei commented on GitHub (Dec 6, 2020):
Fixed in 2.7 as per related issue.