public static function hasOne($modelClass, $columnName, $options = []) {
        $options['type'] = self::HAS_ONE;
        $options['modelClass'] = $modelClass;
        $options['compares'] = [["t.__PK__", (false === strpos($columnName, '.')) ? "r.$columnName" : $columnName, "="]];
        return new self($options);
    }
public static function hasOne($modelClass, $columnName, $options = []) {
        $options['type'] = self::HAS_ONE;
        $options['modelClass'] = $modelClass;
        $options['compares'] = [["t.__PK__", (false === strpos($columnName, '.')) ? "r.$columnName" : $columnName, "="]];
        return new self($options);
    }
public static function hasOne ( $ modelClass , $ columnName , $ options = [ ] ) { $ options [ 'type' ] = self :: HAS_ONE ; $ options [ 'modelClass' ] = $ modelClass ; $ options [ 'compares' ] = [ [ "t.__PK__" , ( false === strpos ( $ columnName , '.' ) ) ? "r.$columnName" : $ columnName , "=" ] ] ; return new self ( $ options ) ; }
Creates a hasOne relation
@param $modelClass
@param $columnName
@param array $options
@return Relation
Creates a hasOne relation