DDC-1627: Create a common interface for all the [Entity|Document]Manager's #2045

Closed
opened 2026-01-22 13:38:27 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 30, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user jcm:

It would be wonderful if were created a common interface for the Managers of the projects Doctrine ORM, CouchDB ODM, and MongoDB ODM. This would facilitate, for example, the creation of classes of service that does not take into account only the Doctrine ORM as a persistence and can therefore be easily exchanged for the MongoDB ODM if necessary, for example:

interface IService {
    public function **construct( PersistenceManager $pm ); 
}

interface PersistenceManager {

    public function find();
    public function persist();
    public function remove();
    public function flush();
    public function getRepository();

    //...
}

class EntityManager implements PersistenceManager {
}

class DocumentManager implements PersistenceManager {
}
Originally created by @doctrinebot on GitHub (Jan 30, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user jcm: It would be wonderful if were created a common interface for the Managers of the projects Doctrine ORM, CouchDB ODM, and MongoDB ODM. This would facilitate, for example, the creation of classes of service that does not take into account only the Doctrine ORM as a persistence and can therefore be easily exchanged for the MongoDB ODM if necessary, for example: ``` php interface IService { public function **construct( PersistenceManager $pm ); } interface PersistenceManager { public function find(); public function persist(); public function remove(); public function flush(); public function getRepository(); //... } class EntityManager implements PersistenceManager { } class DocumentManager implements PersistenceManager { } ```
admin added the Improvement label 2026-01-22 13:38:27 +01:00
admin closed this issue 2026-01-22 13:38:28 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 30, 2012):

Comment created by @beberlei:

This interface does alrady exist and is called ObjectManager. Its in Doctrine\Common\Persistence

@doctrinebot commented on GitHub (Jan 30, 2012): Comment created by @beberlei: This interface does alrady exist and is called ObjectManager. Its in Doctrine\Common\Persistence
Author
Owner

@doctrinebot commented on GitHub (Jan 30, 2012):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jan 30, 2012): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Jan 30, 2012):

Comment created by jcm:

@Eberlei Thanks, I did not know about the existence of these interfaces.

@doctrinebot commented on GitHub (Jan 30, 2012): Comment created by jcm: @Eberlei Thanks, I did not know about the existence of these interfaces.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2045