diff --git a/src/ORM.php b/src/ORM.php index 9436d9f56..a2ac2e37d 100644 --- a/src/ORM.php +++ b/src/ORM.php @@ -92,6 +92,10 @@ public function resolveRole($entity): string $entity = $class; } + if (is_null($this->schema)) { + throw new ORMException('ORM Schema should be defined'); + } + return $this->schema->resolveAlias($entity); }