diff --git a/lib/Doctrine/ODM/MongoDB/DocumentManager.php b/lib/Doctrine/ODM/MongoDB/DocumentManager.php index b71d06e39a..48ef0bf4b4 100644 --- a/lib/Doctrine/ODM/MongoDB/DocumentManager.php +++ b/lib/Doctrine/ODM/MongoDB/DocumentManager.php @@ -50,21 +50,21 @@ class DocumentManager implements ObjectManager /** * The Doctrine MongoDB connection instance. * - * @var Doctrine\MongoDB\Connection + * @var \Doctrine\MongoDB\Connection */ private $connection; /** * The used Configuration. * - * @var Doctrine\ODM\MongoDB\Configuration + * @var \Doctrine\ODM\MongoDB\Configuration */ private $config; /** * The metadata factory, used to retrieve the ODM metadata of document classes. * - * @var Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory + * @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory */ private $metadataFactory; @@ -78,7 +78,7 @@ class DocumentManager implements ObjectManager /** * The UnitOfWork used to coordinate object-level transactions. * - * @var Doctrine\ODM\MongoDB\UnitOfWork + * @var UnitOfWork */ private $unitOfWork; @@ -135,9 +135,9 @@ class DocumentManager implements ObjectManager * Creates a new Document that operates on the given Mongo connection * and uses the given Configuration. * - * @param Doctrine\MongoDB\Connection $conn - * @param Doctrine\ODM\MongoDB\Configuration $config - * @param Doctrine\Common\EventManager $eventManager + * @param \Doctrine\MongoDB\Connection|null $conn + * @param Configuration|null $config + * @param \Doctrine\Common\EventManager|null $eventManager */ protected function __construct(Connection $conn = null, Configuration $config = null, EventManager $eventManager = null) { @@ -189,9 +189,11 @@ public function getProxyFactory() * Creates a new Document that operates on the given Mongo connection * and uses the given Configuration. * - * @param Doctrine\MongoDB\Connection $conn - * @param Doctrine\ODM\MongoDB\Configuration $config - * @param Doctrine\Common\EventManager $eventManager + * @static + * @param \Doctrine\MongoDB\Connection|null $conn + * @param Configuration|null $config + * @param \Doctrine\Common\EventManager|null $eventManager + * @return DocumentManager */ public static function create(Connection $conn = null, Configuration $config = null, EventManager $eventManager = null) { @@ -201,7 +203,7 @@ public static function create(Connection $conn = null, Configuration $config = n /** * Gets the EventManager used by the DocumentManager. * - * @return Doctrine\Common\EventManager + * @return \Doctrine\Common\EventManager */ public function getEventManager() { @@ -210,6 +212,8 @@ public function getEventManager() /** * Gets the PHP Mongo instance that this DocumentManager wraps. + * + * @return \Doctrine\MongoDB\Connection */ public function getConnection() { @@ -219,7 +223,7 @@ public function getConnection() /** * Gets the metadata factory used to gather the metadata of classes. * - * @return Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory + * @return \Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory */ public function getMetadataFactory() { @@ -229,7 +233,7 @@ public function getMetadataFactory() /** * Gets the UnitOfWork used by the DocumentManager to coordinate operations. * - * @return Doctrine\ODM\MongoDB\UnitOfWork + * @return UnitOfWork */ public function getUnitOfWork() { @@ -240,7 +244,7 @@ public function getUnitOfWork() * Gets the Hydrator factory used by the DocumentManager to generate and get hydrators * for each type of document. * - * @return Doctrine\ODM\MongoDB\Hydrator\HydratorInterface + * @return \Doctrine\ODM\MongoDB\Hydrator\HydratorInterface */ public function getHydratorFactory() { @@ -250,7 +254,7 @@ public function getHydratorFactory() /** * Retuns SchemaManager, used to create/drop indexes/collections/databases * - * @return Doctrine\ODM\MongoDB\SchemaManager + * @return \Doctrine\ODM\MongoDB\SchemaManager */ public function getSchemaManager() { @@ -261,7 +265,7 @@ public function getSchemaManager() * Returns the metadata for a class. * * @param string $className The class name. - * @return Doctrine\ODM\MongoDB\Mapping\ClassMetadata + * @return \Doctrine\ODM\MongoDB\Mapping\ClassMetadata * @internal Performance-sensitive method. */ public function getClassMetadata($className) @@ -273,7 +277,7 @@ public function getClassMetadata($className) * Returns the MongoDB instance for a class. * * @param string $className The class name. - * @return Doctrine\MongoDB\Database + * @return \Doctrine\MongoDB\Database */ public function getDocumentDatabase($className) { @@ -302,7 +306,7 @@ public function getDocumentDatabases() * Returns the MongoCollection instance for a class. * * @param string $className The class name. - * @return Doctrine\MongoDB\Collection + * @return \Doctrine\MongoDB\Collection */ public function getDocumentCollection($className) { @@ -338,7 +342,7 @@ public function getDocumentCollections() * Create a new Query instance for a class. * * @param string $documentName The document class name. - * @return Document\ODM\MongoDB\Query\Builder + * @return Query\Builder */ public function createQueryBuilder($documentName = null) { @@ -502,7 +506,9 @@ public function flush(array $options = array()) * has its identifier populated. Otherwise a proxy is returned that automatically * loads itself on first access. * - * @return object The document reference. + * @param string $documentName + * @param string|object $identifier + * @return mixed|object The document reference. */ public function getReference($documentName, $identifier) { @@ -611,7 +617,7 @@ public function contains($document) /** * Gets the Configuration used by the DocumentManager. * - * @return Doctrine\ODM\MongoDB\Configuration + * @return Configuration */ public function getConfiguration() { diff --git a/lib/Doctrine/ODM/MongoDB/DocumentRepository.php b/lib/Doctrine/ODM/MongoDB/DocumentRepository.php index f0e845db02..36d0b51c7c 100644 --- a/lib/Doctrine/ODM/MongoDB/DocumentRepository.php +++ b/lib/Doctrine/ODM/MongoDB/DocumentRepository.php @@ -91,9 +91,10 @@ public function clear() } /** - * Finds a document by its identifier. + * Finds a document by its identifier * - * @param $id The identifier. + * @throws LockException + * @param string|object $id The identifier * @param int $lockMode * @param int $lockVersion * @return object The document. diff --git a/lib/Doctrine/ODM/MongoDB/Query/Builder.php b/lib/Doctrine/ODM/MongoDB/Query/Builder.php index 5b567bf530..600b81909e 100644 --- a/lib/Doctrine/ODM/MongoDB/Query/Builder.php +++ b/lib/Doctrine/ODM/MongoDB/Query/Builder.php @@ -71,60 +71,102 @@ public function __construct(DocumentManager $dm, $cmd, $documentName = null) } } + /** + * @param bool $bool + * @return Builder + */ public function hydrate($bool = true) { $this->hydrate = $bool; return $this; } + /** + * @param bool $bool + * @return Builder + */ public function refresh($bool = true) { $this->refresh = $bool; return $this; } + /** + * Change the query type to find and optionally set and change the class being queried. + * + * @param string $documentName + * @return Builder + */ public function find($documentName = null) { $this->setDocumentName($documentName); return parent::find(); } + /** + * @param string $documentName + * @return Builder + */ public function findAndUpdate($documentName = null) { $this->setDocumentName($documentName); return parent::findAndUpdate(); } + /** + * @param string $documentName + * @return Builder + */ public function findAndRemove($documentName = null) { $this->setDocumentName($documentName); return parent::findAndRemove(); } + /** + * @param string $documentName + * @return Builder + */ public function update($documentName = null) { $this->setDocumentName($documentName); return parent::update(); } + /** + * @param string $documentName + * @return Builder + */ public function insert($documentName = null) { $this->setDocumentName($documentName); return parent::insert(); } + /** + * @param string $documentName + * @return Builder + */ public function remove($documentName = null) { $this->setDocumentName($documentName); return parent::remove(); } + /** + * @param $document + * @return Builder + */ public function references($document) { $this->expr->references($document); return $this; } + /** + * @param $document + * @return Builder + */ public function includesReferenceTo($document) { $this->expr->includesReferenceTo($document); diff --git a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php index 78200c8fa3..84623ae8ff 100644 --- a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php +++ b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php @@ -309,7 +309,7 @@ public function getParentAssociation($document) * Get the document persister instance for the given document name * * @param string $documentName - * @return DocumentPersister + * @return Persisters\DocumentPersister */ public function getDocumentPersister($documentName) { @@ -325,7 +325,7 @@ public function getDocumentPersister($documentName) * Gets a collection persister for a collection-valued association. * * @param array $mapping - * @return CollectionPersister + * @return Persisters\CollectionPersister */ public function getCollectionPersister(array $mapping) { @@ -340,7 +340,7 @@ public function getCollectionPersister(array $mapping) * Set the document persister instance to use for the given document name * * @param string $documentName - * @param DocumentPersister $persister + * @param Persisters\DocumentPersister $persister */ public function setDocumentPersister($documentName, Persisters\DocumentPersister $persister) {