src/Titon/Model/Model.php
public function hasOne($alias, $class, $relatedKey = null, Closure $conditions = null) {
        $relation = (new OneToOne($alias, $class))
            ->setRelatedForeignKey($relatedKey);

        if ($conditions) {
            $relation->setConditions($conditions);
        }

        return $this->addRelation($relation);
    }
public function hasOne($alias, $class, $relatedKey = null, Closure $conditions = null) {
        $relation = (new OneToOne($alias, $class))
            ->setRelatedForeignKey($relatedKey);

        if ($conditions) {
            $relation->setConditions($conditions);
        }

        return $this->addRelation($relation);
    }
public function hasOne ( $ alias , $ class , $ relatedKey = null , Closure $ conditions = null ) { $ relation = ( new OneToOne ( $ alias , $ class ) ) -> setRelatedForeignKey ( $ relatedKey ) ; if ( $ conditions ) { $ relation -> setConditions ( $ conditions ) ; } return $ this -> addRelation ( $ relation ) ; }
Add a one-to-one relationship.

@param string $alias
@param string $class
@param string $relatedKey
@param \Closure $conditions
@return $this
Add a one - to - one relationship .