Merge pull request #951 from md2perpe/MoreInformationalEntityNotFoundException
More informational entity not found exception
This commit is contained in:
commit
6e9b15a48f
@ -30,8 +30,8 @@ class EntityNotFoundException extends ORMException
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct($class)
|
||||||
{
|
{
|
||||||
parent::__construct('Entity was not found.');
|
parent::__construct("Entity of type '{$class}' was not found.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ class ProxyFactory extends AbstractProxyFactory
|
|||||||
$proxy->__setCloner($cloner);
|
$proxy->__setCloner($cloner);
|
||||||
$proxy->__setInitialized(false);
|
$proxy->__setInitialized(false);
|
||||||
|
|
||||||
throw new EntityNotFoundException();
|
throw new EntityNotFoundException($classMetadata->getName());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ class ProxyFactory extends AbstractProxyFactory
|
|||||||
$proxy->__setCloner($cloner);
|
$proxy->__setCloner($cloner);
|
||||||
$proxy->__setInitialized(false);
|
$proxy->__setInitialized(false);
|
||||||
|
|
||||||
throw new EntityNotFoundException();
|
throw new EntityNotFoundException($classMetadata->getName());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ class ProxyFactory extends AbstractProxyFactory
|
|||||||
$original = $entityPersister->loadById($classMetadata->getIdentifierValues($proxy));
|
$original = $entityPersister->loadById($classMetadata->getIdentifierValues($proxy));
|
||||||
|
|
||||||
if (null === $original) {
|
if (null === $original) {
|
||||||
throw new EntityNotFoundException();
|
throw new EntityNotFoundException($classMetadata->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($class->getReflectionClass()->getProperties() as $property) {
|
foreach ($class->getReflectionClass()->getProperties() as $property) {
|
||||||
|
@ -1842,7 +1842,7 @@ class UnitOfWork implements PropertyChangedListener
|
|||||||
// If the identifier is ASSIGNED, it is NEW, otherwise an error
|
// If the identifier is ASSIGNED, it is NEW, otherwise an error
|
||||||
// since the managed entity was not found.
|
// since the managed entity was not found.
|
||||||
if ( ! $class->isIdentifierNatural()) {
|
if ( ! $class->isIdentifierNatural()) {
|
||||||
throw new EntityNotFoundException;
|
throw new EntityNotFoundException($class->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
$managedCopy = $this->newInstance($class);
|
$managedCopy = $this->newInstance($class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user