src/mako/database/midgard/ORM.php
protected function hasOne(string $model, ?string $foreignKey = null): HasOne
	{
		$related = new $model;

		return new HasOne($related->getConnection(), $this, $related, $foreignKey);
	}
protected function hasOne(string $model, ?string $foreignKey = null): HasOne
	{
		$related = new $model;

		return new HasOne($related->getConnection(), $this, $related, $foreignKey);
	}
protected function hasOne ( string $ model , ? string $ foreignKey = null ) : HasOne { $ related = new $ model ; return new HasOne ( $ related -> getConnection ( ) , $ this , $ related , $ foreignKey ) ; }
Returns a HasOne relation.

@param  string                                  $model      Related model
@param  string|null                             $foreignKey Foreign key name
@return \mako\database\midgard\relations\HasOne
Returns a HasOne relation .