[PR #5718] Chaining EntityManager methods #9702

Open
opened 2026-01-22 16:05:10 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/5718

State: closed
Merged: No


Every time when I have to write some code like

 $em->persist($newEntity);
 $em->flush();

my eyes are little bit bleeding.
Can we make methods like "persist" and "remove" chainable?

 $em->persist($newEntity)->flush();

Thank you.

**Original Pull Request:** https://github.com/doctrine/orm/pull/5718 **State:** closed **Merged:** No --- Every time when I have to write some code like ``` $em->persist($newEntity); $em->flush(); ``` my eyes are little bit bleeding. Can we make methods like "persist" and "remove" chainable? ``` $em->persist($newEntity)->flush(); ``` Thank you.
admin added the pull-request label 2026-01-22 16:05:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9702