|
@@ -43,9 +43,9 @@ class DoctrineConverter implements ConverterInterface
|
|
|
$class = $parameter->getClass()->getName();
|
|
|
|
|
|
// find by identifier?
|
|
|
- if (null === $object = $this->find($class, $request)) {
|
|
|
+ if (false === $object = $this->find($class, $request)) {
|
|
|
// find by criteria
|
|
|
- if (null === $object = $this->findOneBy($class, $request)) {
|
|
|
+ if (false === $object = $this->findOneBy($class, $request)) {
|
|
|
throw new \LogicException('Unable to guess how to get a Doctrine instance from the request information.');
|
|
|
}
|
|
|
}
|
|
@@ -60,7 +60,7 @@ class DoctrineConverter implements ConverterInterface
|
|
|
protected function find($class, Request $request)
|
|
|
{
|
|
|
if (!$request->attributes->has('id')) {
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
return $this->manager->getRepository($class)->find($request->attributes->get('id'));
|
|
@@ -77,7 +77,7 @@ class DoctrineConverter implements ConverterInterface
|
|
|
}
|
|
|
|
|
|
if (!$criteria) {
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
return $this->manager->getRepository($class)->findOneBy($criteria);
|