Commit af63f2cb authored by guilhermeblanco's avatar guilhermeblanco

[2.0] Fixed reporting issue with TaskNamespace and some small cosmetic changes

parent 64077ac6
...@@ -237,7 +237,7 @@ class TaskNamespace extends AbstractNamespace ...@@ -237,7 +237,7 @@ class TaskNamespace extends AbstractNamespace
$message .= PHP_EOL . PHP_EOL . $e->getTraceAsString(); $message .= PHP_EOL . PHP_EOL . $e->getTraceAsString();
} }
$printer->writeln($messageMessage, 'ERROR'); $printer->writeln($message, 'ERROR');
// Unable instantiate task or task is not valid // Unable instantiate task or task is not valid
if ($task !== null) { if ($task !== null) {
......
...@@ -457,11 +457,13 @@ class EntityManager ...@@ -457,11 +457,13 @@ class EntityManager
$metadata = $this->getClassMetadata($entityName); $metadata = $this->getClassMetadata($entityName);
$customRepositoryClassName = $metadata->getCustomRepositoryClass(); $customRepositoryClassName = $metadata->getCustomRepositoryClass();
if ($customRepositoryClassName !== null) { if ($customRepositoryClassName !== null) {
$repository = new $customRepositoryClassName($this, $metadata); $repository = new $customRepositoryClassName($this, $metadata);
} else { } else {
$repository = new EntityRepository($this, $metadata); $repository = new EntityRepository($this, $metadata);
} }
$this->_repositories[$entityName] = $repository; $this->_repositories[$entityName] = $repository;
return $repository; return $repository;
...@@ -476,8 +478,8 @@ class EntityManager ...@@ -476,8 +478,8 @@ class EntityManager
public function contains($entity) public function contains($entity)
{ {
return $this->_unitOfWork->isScheduledForInsert($entity) || return $this->_unitOfWork->isScheduledForInsert($entity) ||
$this->_unitOfWork->isInIdentityMap($entity) && $this->_unitOfWork->isInIdentityMap($entity) &&
! $this->_unitOfWork->isScheduledForDelete($entity); ! $this->_unitOfWork->isScheduledForDelete($entity);
} }
/** /**
...@@ -536,6 +538,7 @@ class EntityManager ...@@ -536,6 +538,7 @@ class EntityManager
if ( ! isset($this->_hydrators[$hydrationMode])) { if ( ! isset($this->_hydrators[$hydrationMode])) {
$this->_hydrators[$hydrationMode] = $this->newHydrator($hydrationMode); $this->_hydrators[$hydrationMode] = $this->newHydrator($hydrationMode);
} }
return $this->_hydrators[$hydrationMode]; return $this->_hydrators[$hydrationMode];
} }
...@@ -563,6 +566,7 @@ class EntityManager ...@@ -563,6 +566,7 @@ class EntityManager
default: default:
throw ORMException::invalidHydrationMode($hydrationMode); throw ORMException::invalidHydrationMode($hydrationMode);
} }
return $hydrator; return $hydrator;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment