LMongo\Eloquent\Model::morphOne PHP Method

morphOne() public method

Define a polymorphic one-to-one relationship.
public morphOne ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphOne
$related string
$name string
$type string
$id string
return LMongo\Eloquent\Relation\MorphOne
    public function morphOne($related, $name, $type = null, $id = null)
    {
        $instance = new $related();
        list($type, $id) = $this->getMorphs($name, $type, $id);
        return new MorphOne($instance->newQuery(), $this, $type, $id);
    }
Model