EmptyIdException to make sure we get the right in catch

This commit is contained in:
Mikael Nordfeldth
2016-01-03 22:56:48 +01:00
parent bda30a92bc
commit b4b57bba54
2 changed files with 39 additions and 1 deletions

View File

@@ -384,7 +384,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
static function getByID($id)
{
if (empty($id)) {
throw new ServerException('Empty ID on lookup');
throw new EmptyIdException(get_called_class());
}
// getByPK throws exception if id is null
// or if the class does not have a single 'id' column as primary key