Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implementing initial Doctrine\Common\Persistence interfaces.

  • Loading branch information...
commit 68a40996841b1dbec3b8de5c1038809e5db512b7 1 parent 64088fc
Jonathan H. Wage authored February 15, 2011
3  lib/Doctrine/ORM/EntityManager.php
@@ -21,6 +21,7 @@
21 21
 
22 22
 use Closure, Exception,
23 23
     Doctrine\Common\EventManager,
  24
+    Doctrine\Common\Persistence\ObjectManager,
24 25
     Doctrine\DBAL\Connection,
25 26
     Doctrine\DBAL\LockMode,
26 27
     Doctrine\ORM\Mapping\ClassMetadata,
@@ -37,7 +38,7 @@
37 38
  * @author  Jonathan Wage <jonwage@gmail.com>
38 39
  * @author  Roman Borschel <roman@code-factory.org>
39 40
  */
40  
-class EntityManager
  41
+class EntityManager implements ObjectManager
41 42
 {
42 43
     /**
43 44
      * The used Configuration.
3  lib/Doctrine/ORM/EntityRepository.php
@@ -20,6 +20,7 @@
20 20
 namespace Doctrine\ORM;
21 21
 
22 22
 use Doctrine\DBAL\LockMode;
  23
+use Doctrine\Common\Persistence\ObjectRepository;
23 24
 
24 25
 /**
25 26
  * An EntityRepository serves as a repository for entities with generic as well as
@@ -34,7 +35,7 @@
34 35
  * @author  Jonathan Wage <jonwage@gmail.com>
35 36
  * @author  Roman Borschel <roman@code-factory.org>
36 37
  */
37  
-class EntityRepository
  38
+class EntityRepository implements ObjectRepository
38 39
 {
39 40
     /**
40 41
      * @var string
15  lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -19,6 +19,7 @@
19 19
 
20 20
 namespace Doctrine\ORM\Mapping;
21 21
 
  22
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
22 23
 use ReflectionClass;
23 24
 
24 25
 /**
@@ -39,7 +40,7 @@
39 40
  * @author Jonathan H. Wage <jonwage@gmail.com>
40 41
  * @since 2.0
41 42
  */
42  
-class ClassMetadataInfo
  43
+class ClassMetadataInfo implements ClassMetadata
43 44
 {
44 45
     /* The inheritance mapping types */
45 46
     /**
@@ -778,7 +779,7 @@ protected function _validateAndCompleteAssociationMapping(array $mapping)
778 779
             $mapping['isOwningSide'] = false;
779 780
         }
780 781
 
781  
-        if (isset($mapping['id']) && $mapping['id'] === true && $mapping['type'] & ClassMetadata::TO_MANY) {
  782
+        if (isset($mapping['id']) && $mapping['id'] === true && $mapping['type'] & self::TO_MANY) {
782 783
             throw MappingException::illegalToManyIdentifierAssoaction($this->name, $mapping['fieldName']);
783 784
         }
784 785
         
@@ -1025,6 +1026,16 @@ public function setIdentifier(array $identifier)
1025 1026
     }
1026 1027
 
1027 1028
     /**
  1029
+     * Gets the mapped identifier field of this class.
  1030
+     *
  1031
+     * @return string $identifier
  1032
+     */
  1033
+    public function getIdentifier()
  1034
+    {
  1035
+        return $this->identifier;
  1036
+    }
  1037
+
  1038
+    /**
1028 1039
      * Checks whether the class has a (mapped) field with a certain name.
1029 1040
      *
1030 1041
      * @return boolean
2  lib/vendor/doctrine-common
... ...
@@ -1 +1 @@
1  
-Subproject commit 9d414673bb007e61977341d78745fc5aa316a92b
  1
+Subproject commit 1b112962b09d799237b1b73caf3c838b46d976de

0 notes on commit 68a4099

Please sign in to comment.
Something went wrong with that request. Please try again.