mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Various ideas #6051
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?
Originally created by @theofidry on GitHub (Sep 1, 2018).
Feature Request
In some of our private projects we are "extending" Doctrine to provide some additional features. I would like to know of there would be any interest in porting them back to Doctrine, and given the current development state, I suppose Doctrine 3 rather than 2.
This issue is just a list of the stuff we have privately, so it's more to create a discussion about what could be extracted in RFCs and backported rather than being an RFC itself.
A. A cursor based pagination implementation
B. A specification pattern system.
There is some user libraries already, the difference with ours is that it supports the cursor pagination. I guess however it should backported there (in those libraries) instead.
C. An abstract ORM repository to extend
I'll describe here our current system and then I guess we can discuss about what could be in the core.
First off, we have a different repository interfaces (note that it is not ORM related):
Repository.php
EditableRepository.php
We then have an abstract ORM repository which looks like this:
ORMRepository.php
Then, when we declare a doctrine repository (we also support other kinds like in-memory) as a service, we have a system generating a base repository interface and classes (one for each type, ORM, in-memory, ...) which looks like this:
GeneratedRepository.php
GeneratedORMRepository.php
We then have our regular repository interface, ORM/in-memory/... classes which extend their respective generated class. This allows to have typehinted methods for each entity without having to write them down manually which is both tedious and error prone.
An extension to deal with foreign keys
We extend the doctrine schema to allow something like the following:
which would generate something like:
(works on a regular field and ids)
Synchronization of owned values
When dealing with a one-to-many in Doctrine, it can be pretty annoying. To deal with that, we have an
OwnedValuebase class:OwnedValue.php
The code of the class above is non-trivial, but then it declaring a one-to-many relation is relatively simple:
Owner.orm.xml
With the three following entities:
Owner.php
And the magic entity:
OwnerOwnedEntity.php
Any interest merging any of this in the core?
@setineos commented on GitHub (Jul 3, 2025):
For my part, I'd be very interested in a cursor based pagination implementation