[PR #29] Entity manager persist and flush #7617

Closed
opened 2026-01-22 15:56:01 +01:00 by admin · 0 comments
Owner

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

State: closed
Merged: No


Hello,

I have added a shortcut method to the EntityManager class: persistAndFlush()

Generally, developers need to persist and flush one single entity at a time. That means, we need to write two lines of code in controllers. The goal is to reduce a bit the number of lines of code by calling one single line of code, which is responsible to persist and flush the entity immediatly.

I didn't manage to run the tests suite so I cannot guarantee tests pass. Please, run the tests suite before applying the patch if you are convinced of its added value to the API.

Hugo Hamon
Sensio Labs Trainings Manager.

**Original Pull Request:** https://github.com/doctrine/orm/pull/29 **State:** closed **Merged:** No --- Hello, I have added a shortcut method to the EntityManager class: persistAndFlush() Generally, developers need to persist and flush one single entity at a time. That means, we need to write two lines of code in controllers. The goal is to reduce a bit the number of lines of code by calling one single line of code, which is responsible to persist and flush the entity immediatly. I didn't manage to run the tests suite so I cannot guarantee tests pass. Please, run the tests suite before applying the patch if you are convinced of its added value to the API. Hugo Hamon Sensio Labs Trainings Manager.
admin added the pull-request label 2026-01-22 15:56:01 +01:00
admin closed this issue 2026-01-22 15:56:01 +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#7617