- Some minor bugfixes done on the return type of searchRelation

This commit is contained in:
Dave M. 2022-11-29 19:51:03 +00:00
parent 902167c2ed
commit 497fe5547b
1 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class RelationBuilder
} }
} }
public function searchRelation(string $name) /* : object|EntityCollection|bool */ public function searchRelation(string $name) : object|bool
{ {
# Resolve relations here if one is called # Resolve relations here if one is called
if ( $this->entity->isLoaded() ) { if ( $this->entity->isLoaded() ) {
@ -45,7 +45,7 @@ class RelationBuilder
return $dataset; return $dataset;
} }
return $this->resolveRelation($name) ?: $this->resolveVirtual($name); return $this->resolveRelation($name) ?: $this->resolveVirtual($name) ?: false;
} }
else { else {
if ( $relation = $this->resolver->searchFieldAnnotation($name, new Relation() ) ) { if ( $relation = $this->resolver->searchFieldAnnotation($name, new Relation() ) ) {