protected function setHasOne($key, Model $model = null)
    {
        if (true === $this->isInverse($key)) {
            throw ModelException::cannotModifyInverse($this, $key);
        }
        if (null !== $model) {
            $this->validateRelSet($key, $model->getType());
        }
        $this->touch();
        $this->hasOneRelationships->set($key, $model);
        $this->doDirtyCheck();
        return $this;
    }