Skip to content

Commit

Permalink
Merge pull request doctrine#128 from epicwhale/master
Browse files Browse the repository at this point in the history
Fixed PHPDoc inconsistencies and issues at various locations.
  • Loading branch information
jwage committed Jul 20, 2011
2 parents c29ca97 + be4620f commit 337bbbe
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 26 deletions.
48 changes: 27 additions & 21 deletions lib/Doctrine/ODM/MongoDB/DocumentManager.php
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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()
{
Expand All @@ -210,6 +212,8 @@ public function getEventManager()

/**
* Gets the PHP Mongo instance that this DocumentManager wraps.
*
* @return \Doctrine\MongoDB\Connection
*/
public function getConnection()
{
Expand All @@ -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()
{
Expand All @@ -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()
{
Expand All @@ -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()
{
Expand All @@ -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()
{
Expand All @@ -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)
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()
{
Expand Down
5 changes: 3 additions & 2 deletions lib/Doctrine/ODM/MongoDB/DocumentRepository.php
Expand Up @@ -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.
Expand Down
42 changes: 42 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Query/Builder.php
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/ODM/MongoDB/UnitOfWork.php
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down

0 comments on commit 337bbbe

Please sign in to comment.