protected function findType($foreignKey, $remote)
    {
        if ($remote) {
            if ($this->isBelongsToMany($foreignKey)) {
                return 'belongsToMany';
            }
            if ($this->isHasOne($foreignKey)) {
                return 'hasOne';
            }

            return 'hasMany';
        } else {
            return 'belongsTo';
        }
    }
protected function findType($foreignKey, $remote)
    {
        if ($remote) {
            if ($this->isBelongsToMany($foreignKey)) {
                return 'belongsToMany';
            }
            if ($this->isHasOne($foreignKey)) {
                return 'hasOne';
            }

            return 'hasMany';
        } else {
            return 'belongsTo';
        }
    }
protected function findType ( $ foreignKey , $ remote ) { if ( $ remote ) { if ( $ this -> isBelongsToMany ( $ foreignKey ) ) { return 'belongsToMany' ; } if ( $ this -> isHasOne ( $ foreignKey ) ) { return 'hasOne' ; } return 'hasMany' ; } else { return 'belongsTo' ; } }
Try to determine the type of the relation.

@param $foreignKey
@param $remote

@return string
Try to determine the type of the relation .