Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit bebc77c

Browse files
authored
Update SingularRelation.php
1 parent 103927a commit bebc77c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

source/Spiral/ORM/Entities/Relations/SingularRelation.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ abstract class SingularRelation extends AbstractRelation
3737
*/
3838
public function hasRelated(): bool
3939
{
40-
if (!$this->isLoaded()) {
41-
//Lazy loading our relation data
42-
$this->loadData();
43-
}
44-
45-
return !empty($this->instance);
40+
return !empty($this->getRelated());
4641
}
4742

4843
/**
@@ -131,4 +126,4 @@ protected function isPlaceholderNeeded(): bool
131126
{
132127
return static::CREATE_PLACEHOLDER;
133128
}
134-
}
129+
}

0 commit comments

Comments
 (0)