Result/ResultCollection.php
public function filter(ScopeInterface $scope)
    {
        $filtered = new self;

        foreach ($this as $eachResult) {
            /* @var $eachResult ResultInterface */
            if ($eachResult->getScope()->isEqualTo($scope)) {
                $filtered->add($eachResult);
            }
        }

        return $filtered;
    }
public function filter(ScopeInterface $scope)
    {
        $filtered = new self;

        foreach ($this as $eachResult) {
            /* @var $eachResult ResultInterface */
            if ($eachResult->getScope()->isEqualTo($scope)) {
                $filtered->add($eachResult);
            }
        }

        return $filtered;
    }
public function filter ( ScopeInterface $ scope ) { $ filtered = new self ; foreach ( $ this as $ eachResult ) { /* @var $eachResult ResultInterface */ if ( $ eachResult -> getScope ( ) -> isEqualTo ( $ scope ) ) { $ filtered -> add ( $ eachResult ) ; } } return $ filtered ; }
Filter the currect set of results by the given scope.

@param ScopeInterface $scope

@return ResultCollection|ResultInterface[]
Filter the currect set of results by the given scope .