This commit is contained in:
xl
2024-11-06 20:59:30 +08:00
parent 41166dd998
commit f563126cd0
4 changed files with 9 additions and 10 deletions
+2 -2
View File
@@ -12,6 +12,7 @@ namespace Database;
use Database\Traits\HasBase;
use Exception;
use Kiri;
use Kiri\Di\Context;
/**
* Class HasOne
@@ -27,7 +28,6 @@ class HasOne extends HasBase
*/
public function get(): array|ModelInterface|null
{
$relation = Kiri::getDi()->get(Relation::class);
return $relation->first($this->name);
return Context::get(Relation::class)->first($this->name);
}
}