mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Bug by inserting data #5827
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 @infastra on GitHub (Dec 31, 2017).
Originally assigned to: @Ocramius on GitHub.
I try to create a new database entry by using the class EntityManager with the method flush especially for one Entity. After call the method flush, I get the error SQLSTATE[HY093]: Invalid parameter number: no parameters were bound.
Here is my source code:
When I only want to update an entity, it works.
After debugging I found out that the class Doctrine\ORM\UnitOfWork didn't have the entity in its entityChangeSet array in line 530.
I'm using version 2.5.14 of Doctrine.
When I call the flush method without any parameter it works. So did I use the method in a wrong way? What could I do when I want to insert data in one entity?
@Ocramius commented on GitHub (Jan 1, 2018):
EntityManager#flush()expects aobject|object[]|nullas parameter.Besides that, flushing single entities is deprecated and already removed in
develop, which is going to be ORM 3.0. I strongly endorse not usingEntityManager#flush($entity), but onlyEntityManager#flush().