From af63f2cb6df8ab7a5232c7c4a0bdb33141650694 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Mon, 8 Mar 2010 21:03:04 +0000 Subject: [PATCH] [2.0] Fixed reporting issue with TaskNamespace and some small cosmetic changes --- lib/Doctrine/Common/Cli/TaskNamespace.php | 2 +- lib/Doctrine/ORM/EntityManager.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/Common/Cli/TaskNamespace.php b/lib/Doctrine/Common/Cli/TaskNamespace.php index d6af7e75d..b75cdec8f 100644 --- a/lib/Doctrine/Common/Cli/TaskNamespace.php +++ b/lib/Doctrine/Common/Cli/TaskNamespace.php @@ -237,7 +237,7 @@ class TaskNamespace extends AbstractNamespace $message .= PHP_EOL . PHP_EOL . $e->getTraceAsString(); } - $printer->writeln($messageMessage, 'ERROR'); + $printer->writeln($message, 'ERROR'); // Unable instantiate task or task is not valid if ($task !== null) { diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 229884dea..b3b19e905 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -457,11 +457,13 @@ class EntityManager $metadata = $this->getClassMetadata($entityName); $customRepositoryClassName = $metadata->getCustomRepositoryClass(); + if ($customRepositoryClassName !== null) { $repository = new $customRepositoryClassName($this, $metadata); } else { $repository = new EntityRepository($this, $metadata); } + $this->_repositories[$entityName] = $repository; return $repository; @@ -476,8 +478,8 @@ class EntityManager public function contains($entity) { return $this->_unitOfWork->isScheduledForInsert($entity) || - $this->_unitOfWork->isInIdentityMap($entity) && - ! $this->_unitOfWork->isScheduledForDelete($entity); + $this->_unitOfWork->isInIdentityMap($entity) && + ! $this->_unitOfWork->isScheduledForDelete($entity); } /** @@ -536,6 +538,7 @@ class EntityManager if ( ! isset($this->_hydrators[$hydrationMode])) { $this->_hydrators[$hydrationMode] = $this->newHydrator($hydrationMode); } + return $this->_hydrators[$hydrationMode]; } @@ -563,6 +566,7 @@ class EntityManager default: throw ORMException::invalidHydrationMode($hydrationMode); } + return $hydrator; }