mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #29] Entity manager persist and flush #7617
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?
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.