Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implementing Doctrine\Common\Persistence interfaces.

  • Loading branch information...
commit 8d02e8439fb6737de1e23e1953a643858a8a6c68 1 parent e4dc2ad
@jwage jwage authored
View
5 lib/Doctrine/ODM/MongoDB/DocumentManager.php
@@ -28,7 +28,8 @@
Doctrine\ODM\MongoDB\Proxy\ProxyFactory,
Doctrine\Common\Collections\ArrayCollection,
Doctrine\Common\EventManager,
- Doctrine\ODM\MongoDB\Hydrator\HydratorFactory;
+ Doctrine\ODM\MongoDB\Hydrator\HydratorFactory,
+ Doctrine\Common\Persistence\ObjectManager;
/**
* The DocumentManager class is the central access point for managing the
@@ -45,7 +46,7 @@
* @author Jonathan H. Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
-class DocumentManager
+class DocumentManager implements ObjectManager
{
/**
* The Doctrine MongoDB connection instance.
View
4 lib/Doctrine/ODM/MongoDB/DocumentRepository.php
@@ -20,6 +20,8 @@
namespace Doctrine\ODM\MongoDB;
+use Doctrine\Common\Persistence\ObjectRepository;
+
/**
* An DocumentRepository serves as a repository for documents with generic as well as
* business specific methods for retrieving documents.
@@ -33,7 +35,7 @@
* @author Jonathan H. Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
-class DocumentRepository
+class DocumentRepository implements ObjectRepository
{
/**
* @var string
View
20 lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php
@@ -52,6 +52,13 @@ class ClassMetadata extends ClassMetadataInfo
public $reflFields = array();
/**
+ * The prototype from which new instances of the mapped class are created.
+ *
+ * @var object
+ */
+ private $prototype;
+
+ /**
* Initializes a new ClassMetadata instance that will hold the object-document mapping
* metadata of the class with the given name.
*
@@ -178,4 +185,17 @@ public function __wakeup()
$this->reflFields[$field] = $reflField;
}
}
+
+ /**
+ * Creates a new instance of the mapped class, without invoking the constructor.
+ *
+ * @return object
+ */
+ public function newInstance()
+ {
+ if ($this->prototype === null) {
+ $this->prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
+ }
+ return clone $this->prototype;
+ }
}
View
35 lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php
@@ -21,6 +21,7 @@
use Doctrine\ODM\MongoDB\MongoDBException,
Doctrine\ODM\MongoDB\LockException,
+ Doctrine\Common\Persistence\Mapping\ClassMetadata,
ReflectionClass;
/**
@@ -43,7 +44,7 @@
* @author Jonathan H. Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
-class ClassMetadataInfo
+class ClassMetadataInfo implements ClassMetadata
{
/* The Id generator types. */
/**
@@ -211,13 +212,6 @@ class ClassMetadataInfo
public $reflFields = array();
/**
- * The prototype from which new instances of the mapped class are created.
- *
- * @var object
- */
- private $prototype;
-
- /**
* READ-ONLY: The inheritance mapping type used by the class.
*
* @var integer
@@ -405,7 +399,7 @@ public function isIdentifier($fieldName)
* INTERNAL:
* Sets the mapped identifier field of this class.
*
- * @param array $identifier
+ * @param string $identifier
*/
public function setIdentifier($identifier)
{
@@ -413,6 +407,16 @@ public function setIdentifier($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
@@ -1449,17 +1453,4 @@ public function setLockField($lockField)
{
$this->lockField = $lockField;
}
-
- /**
- * Creates a new instance of the mapped class, without invoking the constructor.
- *
- * @return object
- */
- public function newInstance()
- {
- if ($this->prototype === null) {
- $this->prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
- }
- return clone $this->prototype;
- }
}
2  lib/vendor/doctrine-common
@@ -1 +1 @@
-Subproject commit ecc8c938500809e3677a3167ff5cadb303c8da67
+Subproject commit 59e6b8c6edcb271622923035b687a063c2b47ce8

0 comments on commit 8d02e84

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