protected function applyScope(ExtendedRepositoryInterface $repository, $scope = null)
    {
        $scope = (null === $scope) ? $this->activeScope : $scope;

        $repository->clearScopes();

        if ($this->hasActiveListParent()) {
            return $this;
        }

        if ($scope) {

            $info = $this->getModelInformation();

            $method = $info->list->scopes[ $scope ]->method ?: $scope;

            $repository->addScope($method);
        }

        return $this;
    }
protected function applyScope(ExtendedRepositoryInterface $repository, $scope = null)
    {
        $scope = (null === $scope) ? $this->activeScope : $scope;

        $repository->clearScopes();

        if ($this->hasActiveListParent()) {
            return $this;
        }

        if ($scope) {

            $info = $this->getModelInformation();

            $method = $info->list->scopes[ $scope ]->method ?: $scope;

            $repository->addScope($method);
        }

        return $this;
    }
protected function applyScope ( ExtendedRepositoryInterface $ repository , $ scope = null ) { $ scope = ( null === $ scope ) ? $ this -> activeScope : $ scope ; $ repository -> clearScopes ( ) ; if ( $ this -> hasActiveListParent ( ) ) { return $ this ; } if ( $ scope ) { $ info = $ this -> getModelInformation ( ) ; $ method = $ info -> list -> scopes [ $ scope ] -> method ? : $ scope ; $ repository -> addScope ( $ method ) ; } return $ this ; }
Applies the currently active scope to a repository.

@param ExtendedRepositoryInterface $repository
@param null|string                 $scope        active if not given
@return $this
Applies the currently active scope to a repository .