Uploaded image for project: 'Doctrine Common'
  1. Doctrine Common
  2. DCOM-28

Extract Common Persistance Interfaces

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      I discussed this with jwage on symfony day cologne and this also came up during discussions with @dzuelke at IPC yesterday. So i hacked up a first patch for discussion that adds a Doctrine\Common\Persistance namespace and extracts the functionality all our 3 layers implement with regards to EntityManager/EntityRepository (and equivalents).

      Additionally i think it might make sense to also add an interface "ObjectMetadata" that has several getters-only that allow access to the field, identifier and association mapping information. This stuff is not necessarly compatible across layers when returned as its "array" representation, but for libraries hooking into the metadata (symfony admin generator) this might not even be necessary.

        Issue Links

          Activity

          Hide
          guilhermeblanco Guilherme Blanco added a comment -

          Closing as this was already done previously.

          Show
          guilhermeblanco Guilherme Blanco added a comment - Closing as this was already done previously.
          Hide
          lsmith Lukas Kahwe added a comment -

          i want to heat this topic back up:

          • findMany()
          • id generator API
          Show
          lsmith Lukas Kahwe added a comment - i want to heat this topic back up: findMany() id generator API
          Hide
          jwage Jonathan H. Wage added a comment -

          To find by things in MongoDB you just give an array of key => value pairs. It gets passed straight through to MongoDB. The $in syntax is just soemthing mongodb supports. It's not anything specific to Doctrine.

          Show
          jwage Jonathan H. Wage added a comment - To find by things in MongoDB you just give an array of key => value pairs. It gets passed straight through to MongoDB. The $in syntax is just soemthing mongodb supports. It's not anything specific to Doctrine.
          Hide
          beberlei Benjamin Eberlei added a comment -

          Hm, What is this syntax? This is not conforming to the EntityRepository interface.

          The only two allowed methods are:

          IN Query:

          $ids = array(...);
          findBy(array('_id' => $ids)); 
          

          Equals = Query:

          $ids = 1234;
          findBy(array('_id' => $id)); 
          

          Everything else is not portable accross implementations and should only be able through DocumentManager::CreateQuery* sort of apis.

          Show
          beberlei Benjamin Eberlei added a comment - Hm, What is this syntax? This is not conforming to the EntityRepository interface. The only two allowed methods are: IN Query: $ids = array(...); findBy(array('_id' => $ids)); Equals = Query: $ids = 1234; findBy(array('_id' => $id)); Everything else is not portable accross implementations and should only be able through DocumentManager::CreateQuery* sort of apis.
          Hide
          jwage Jonathan H. Wage added a comment -

          Yes, findMany() is possible with MongoDB.

          I think it would just be a proxy to:

          public function findMany(array $ids)
          {
              return $this->findBy(array('_id' => array('$in' => $ids)));
          }
          
          Show
          jwage Jonathan H. Wage added a comment - Yes, findMany() is possible with MongoDB. I think it would just be a proxy to: public function findMany(array $ids) { return $ this ->findBy(array('_id' => array('$in' => $ids))); }

            People

            • Assignee:
              guilhermeblanco Guilherme Blanco
              Reporter:
              beberlei Benjamin Eberlei
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: