src/Listify.php
protected function normalizeListifyScope($scope, $doNotResolveBelongsTo = false)
    {
        if ($scope instanceof BelongsTo) {
            if ($doNotResolveBelongsTo) return $scope;

            return $this->getConditionStringFromBelongsTo($scope);
        }

        if ($scope instanceof QueryBuilder) {
            return $this->getConditionStringFromQueryBuilder($scope);
        }

        if (is_callable($scope)) {
            return $this->normalizeListifyScope( $scope($this) );
        }

        // scope can only be a string in this case
        return $scope;
    }
protected function normalizeListifyScope($scope, $doNotResolveBelongsTo = false)
    {
        if ($scope instanceof BelongsTo) {
            if ($doNotResolveBelongsTo) return $scope;

            return $this->getConditionStringFromBelongsTo($scope);
        }

        if ($scope instanceof QueryBuilder) {
            return $this->getConditionStringFromQueryBuilder($scope);
        }

        if (is_callable($scope)) {
            return $this->normalizeListifyScope( $scope($this) );
        }

        // scope can only be a string in this case
        return $scope;
    }
protected function normalizeListifyScope ( $ scope , $ doNotResolveBelongsTo = false ) { if ( $ scope instanceof BelongsTo ) { if ( $ doNotResolveBelongsTo ) return $ scope ; return $ this -> getConditionStringFromBelongsTo ( $ scope ) ; } if ( $ scope instanceof QueryBuilder ) { return $ this -> getConditionStringFromQueryBuilder ( $ scope ) ; } if ( is_callable ( $ scope ) ) { return $ this -> normalizeListifyScope ( $ scope ( $ this ) ) ; } // scope can only be a string in this case return $ scope ; }
Normalizes the currently applicable list scope to a string
or BelongsTo relation instance.

@param mixed   $scope
@param boolean $doNotResolveBelongsTo        if true, does not stringify a BelongsTo instance
@return string|BelongsTo
Normalizes the currently applicable list scope to a string or BelongsTo relation instance .