Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implementing initial Doctrine\Common\Persistence interfaces.

  • Loading branch information...
commit 68a40996841b1dbec3b8de5c1038809e5db512b7 1 parent 64088fc
@jwage jwage authored
View
3  lib/Doctrine/ORM/EntityManager.php
@@ -21,6 +21,7 @@
use Closure, Exception,
Doctrine\Common\EventManager,
+ Doctrine\Common\Persistence\ObjectManager,
Doctrine\DBAL\Connection,
Doctrine\DBAL\LockMode,
Doctrine\ORM\Mapping\ClassMetadata,
@@ -37,7 +38,7 @@
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
-class EntityManager
+class EntityManager implements ObjectManager
{
/**
* The used Configuration.
View
3  lib/Doctrine/ORM/EntityRepository.php
@@ -20,6 +20,7 @@
namespace Doctrine\ORM;
use Doctrine\DBAL\LockMode;
+use Doctrine\Common\Persistence\ObjectRepository;
/**
* An EntityRepository serves as a repository for entities with generic as well as
@@ -34,7 +35,7 @@
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
-class EntityRepository
+class EntityRepository implements ObjectRepository
{
/**
* @var string
View
15 lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -19,6 +19,7 @@
namespace Doctrine\ORM\Mapping;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use ReflectionClass;
/**
@@ -39,7 +40,7 @@
* @author Jonathan H. Wage <jonwage@gmail.com>
* @since 2.0
*/
-class ClassMetadataInfo
+class ClassMetadataInfo implements ClassMetadata
{
/* The inheritance mapping types */
/**
@@ -778,7 +779,7 @@ protected function _validateAndCompleteAssociationMapping(array $mapping)
$mapping['isOwningSide'] = false;
}
- if (isset($mapping['id']) && $mapping['id'] === true && $mapping['type'] & ClassMetadata::TO_MANY) {
+ if (isset($mapping['id']) && $mapping['id'] === true && $mapping['type'] & self::TO_MANY) {
throw MappingException::illegalToManyIdentifierAssoaction($this->name, $mapping['fieldName']);
}
@@ -1025,6 +1026,16 @@ public function setIdentifier(array $identifier)
}
/**
+ * Gets the mapped identifier field of this class.
+ *
+ * @return string $identifier
+ */
+ public function getIdentifier()
+ {
+ return $this->identifier;
+ }
+
+ /**
* Checks whether the class has a (mapped) field with a certain name.
*
* @return boolean
2  lib/vendor/doctrine-common
@@ -1 +1 @@
-Subproject commit 9d414673bb007e61977341d78745fc5aa316a92b
+Subproject commit 1b112962b09d799237b1b73caf3c838b46d976de
Please sign in to comment.
Something went wrong with that request. Please try again.