fix exceptions

This commit is contained in:
Yuri Kuznetsov
2021-03-22 09:16:45 +02:00
parent 4380175c8b
commit c4861c5efa
3 changed files with 9 additions and 11 deletions
@@ -41,7 +41,6 @@ use Espo\ORM\{
use StdClass;
use RuntimeException;
use InvalidArgumentException;
class RDBRepository extends Repository
{
@@ -232,7 +231,7 @@ class RDBRepository extends Repository
$params = $params ?? [];
if ($entity->getEntityType() !== $this->entityType) {
throw new InvalidArgumentException("Not supported entity type.");
throw new RuntimeException("Not supported entity type.");
}
if (!$entity->id) {
@@ -283,7 +282,7 @@ class RDBRepository extends Repository
$params = $params ?? [];
if ($entity->getEntityType() !== $this->entityType) {
throw new InvalidArgumentException("Not supported entity type.");
throw new RuntimeException("Not supported entity type.");
}
if (!$entity->id) {
@@ -373,7 +372,7 @@ class RDBRepository extends Repository
}
if ($entity->getEntityType() !== $this->entityType) {
throw new InvalidArgumentException("Not supported entity type.");
throw new RuntimeException("Not supported entity type.");
}
if ($foreign instanceof Entity) {
@@ -421,7 +420,7 @@ class RDBRepository extends Repository
}
if ($entity->getEntityType() !== $this->entityType) {
throw new InvalidArgumentException("Not supported entity type.");
throw new RuntimeException("Not supported entity type.");
}
$this->beforeRelate($entity, $relationName, $foreign, $columnData, $options);
@@ -478,7 +477,7 @@ class RDBRepository extends Repository
}
if ($entity->getEntityType() !== $this->entityType) {
throw new InvalidArgumentException("Not supported entity type.");
throw new RuntimeException("Not supported entity type.");
}
$this->beforeUnrelate($entity, $relationName, $foreign, $options);