Custom entity persister? #6428

Closed
opened 2026-01-22 15:33:02 +01:00 by admin · 1 comment
Owner

Originally created by @gjdanis on GitHub (Mar 19, 2020).

Feature Request

Q A
New Feature yes

Summary

Right now it's not possible to declare a custom persister for an entity. The specific use case I'm asking about is for MS SQL Server where one of my tables has a trigger that inserts into another another table. For this entity I want to use OUTPUT in my INSERT statements to get the correct identity value.

It seems like we should be able to inject this somewhere in the UnitOfWork or perhaps provide it as metadata on the entity: 99b7d1e9d4/lib/Doctrine/ORM/UnitOfWork.php (L2562)

@morozov tagging you for visibility.

Originally created by @gjdanis on GitHub (Mar 19, 2020). ### Feature Request <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | New Feature | yes #### Summary Right now it's not possible to declare a custom persister for an entity. The specific use case I'm asking about is for MS SQL Server where one of my tables has a trigger that inserts into another another table. For this entity I want to use `OUTPUT` in my `INSERT` statements to get the correct identity value. It seems like we should be able to inject this somewhere in the UnitOfWork or perhaps provide it as metadata on the entity: https://github.com/doctrine/orm/blob/99b7d1e9d4bfa6efb86f0a77b1e5522ec8e9bf9a/lib/Doctrine/ORM/UnitOfWork.php#L2562 @morozov tagging you for visibility.
admin closed this issue 2026-01-22 15:33:03 +01:00
Author
Owner

@beberlei commented on GitHub (Sep 25, 2020):

This is by design, building a persister is really difficult and we want to avoid introducing this extension point.

@beberlei commented on GitHub (Sep 25, 2020): This is by design, building a persister is really difficult and we want to avoid introducing this extension point.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6428