Differences for flush ObjectManager <-> vs. EntityManager #4941

Closed
opened 2026-01-22 14:53:18 +01:00 by admin · 5 comments
Owner

Originally created by @firegate666 on GitHub (Dec 17, 2015).

Originally assigned to: @Majkl578 on GitHub.

Hi,

is there a reason why flush() for EntityManager accepts an entity and ObjectManager does not? Would it make sense to add this altered method signature at least to the EntityManagerInterface?

Even the EntityManagerDecorator complains about the signature change (method called with 1 parameter, but 0 expected).

Originally created by @firegate666 on GitHub (Dec 17, 2015). Originally assigned to: @Majkl578 on GitHub. Hi, is there a reason why `flush()` for `EntityManager` accepts an entity and `ObjectManager` does not? Would it make sense to add this altered method signature at least to the `EntityManagerInterface`? Even the `EntityManagerDecorator` complains about the signature change (method called with 1 parameter, but 0 expected).
admin added the Improvement label 2026-01-22 14:53:18 +01:00
admin closed this issue 2026-01-22 14:53:18 +01:00
Author
Owner

@ghost commented on GitHub (Jan 6, 2016):

  • EntityManager accepts an entity. (ORM)
  • DocumentManager accepts an document. (ODM)
  • ObjectManager is the abstract class of both.
@ghost commented on GitHub (Jan 6, 2016): - EntityManager accepts an entity. (ORM) - DocumentManager accepts an document. (ODM) - ObjectManager is the abstract class of both.
Author
Owner

@deeky666 commented on GitHub (Jan 6, 2016):

I suppose that the optional parameter was introduced in ORM/ODM after the common ObjectManager interface was established. Therefore changing this would be a BC break and cannot be fixed before the next major version of the common lib.

@deeky666 commented on GitHub (Jan 6, 2016): I suppose that the optional parameter was introduced in ORM/ODM after the common ObjectManager interface was established. Therefore changing this would be a BC break and cannot be fixed before the next major version of the common lib.
Author
Owner

@firegate666 commented on GitHub (Jan 6, 2016):

Too bad ...

@firegate666 commented on GitHub (Jan 6, 2016): Too bad ...
Author
Owner

@Ocramius commented on GitHub (Jan 6, 2016):

The optional parameter was introduced as an optimization, and has caused only problems since then. It will likely also disappear in future :-P

@Ocramius commented on GitHub (Jan 6, 2016): The optional parameter was introduced as an optimization, and has caused only problems since then. It will likely also disappear in future :-P
Author
Owner

@Majkl578 commented on GitHub (Dec 20, 2017):

This disparity will be removed in Doctrine 3.0, flush will not accept entity parameter anymore. @Ocramius was right again. 🤣

@Majkl578 commented on GitHub (Dec 20, 2017): This disparity will be removed in Doctrine 3.0, flush will not accept entity parameter anymore. @Ocramius was right again. 🤣
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4941