Skip to content

Commit

Permalink
error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
yurikuzn committed Apr 6, 2023
1 parent 65bef1d commit 8bca359
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Espo\ORM\Defs\RelationDefs;
use Espo\ORM\Type\AttributeType;
use Espo\ORM\Type\RelationType;
use LogicException;
use RuntimeException;

class RelationConverter
Expand Down Expand Up @@ -87,9 +88,13 @@ public function process(string $name, array $params, string $entityType, array $
$params['relationName'] = $relationshipName;
}

$linkType = $params['type'];
$linkType = $params['type'] ?? null;
$foreignLinkType = $foreignParams ? $foreignParams['type'] : null;

if (!$linkType) {
throw new LogicException("Link {$entityType}.{$name} has no type.");
}

$params['hasField'] = (bool) $this->metadata
->get(['entityDefs', $entityType, 'fields', $name]);

Expand Down

0 comments on commit 8bca359

Please sign in to comment.