Export data with scope.

@param string $scope

@return $this
960909
public function withScope($scope)
    {
        if ($scope == Grid\Exporter::SCOPE_ALL) {
            return $this;
        }

        list($scope, $args) = explode(':', $scope);

        if ($scope == Grid\Exporter::SCOPE_CURRENT_PAGE) {
            $this->grid->model()->usePaginate(true);
        }

        if ($scope == Grid\Exporter::SCOPE_SELECTED_ROWS) {
            $selected = explode(',', $args);
            $this->grid->model()->whereIn($this->grid->getKeyName(), $selected);
        }

        return $this;
    }
859262
public static function flush($scope = null) {
		if (empty($scope)) {
			self::$implementedEvents = self::$loadedListeners = self::$loadedScopes = array();
			return;
		}

		// foreach (self::)
	}
391400
public function purge($scope = null)
    {
        // Get scope if not passed
        if (null === $scope) {
            $scope = $this->getScope();
        }

        // Return result of purge
        return $this->getContainer()->purge($scope);
    }
928596
public function setScopes(Mutable $scopes = null)
    {
        if ($scopes && $scopes->count()) {
            $scopes->prepend(
                new Scope('all')
            );
        }

        $this->scopes = $scopes;

        return $this;
    }
580155
public function setScope($scope)
    {
        $validScopes = ['col', 'row', 'colgroup', 'rowgroup'];

        if (!StringHelper::isOneOf($scope, $validScopes)) {
            throw new \Exception(sprintf('"%s" is not a valid <td> scope. Valid are: %s', $scope, implode(', ', $validScopes)));
        }

        $this->attributes->set('scope', $scope);

        return $this;
    }
240667
public function read($scope = null)
    {
        $scope = $scope === null ? ContainerScopeInterface::SCOPE_DEFAULT : $scope;
        if ($scope !== ContainerScopeInterface::SCOPE_DEFAULT) {
            throw new \Magento\Framework\Exception\LocalizedException(__("Only default scope allowed"));
        }

        $config = $this->initialConfig->getData($scope);

        $collection = $this->collectionFactory->create(
            ['scope' => $scope]
        );

        $dbDefaultConfig = [];
        foreach ($collection as $item) {
            $dbDefaultConfig[$item->getPath()] = $item->getValue();
        }

        $dbDefaultConfig = $this->converter->convert($dbDefaultConfig);
        $config = array_replace_recursive($config, $dbDefaultConfig);

        return $config;
    }
1048843
public function transform(Scope $scope)
    {
        $resource = $scope->resource();
        
        // When we encounter a null resource, we just return null because
        // there's nothing else we can do with it.
        if ($resource === null) {
            return null;
        }
        
        // If the resource is not a ResourceInterface instance we allow it to be
        // something array-like.
        if (!($resource instanceof ResourceInterface)) {
            if (\is_array($resource)) {
                return $resource;
            }
            if (\is_object($resource) && method_exists($resource, 'toArray')) {
                return $resource->toArray();
            }

            throw new UnhandledResourceType('Unable to serialize resource of type ' . \gettype($resource));
        }

        // Try to resolve a transformer for a resource that does not have one
        // assigned.
        if (!$resource->hasTransformer()) {
            $transformer = $this->resolveTransformerForResource($resource);
            $resource->setTransformer($transformer);
        }

        // Call the relationship loader for any relations
        $this->loadRelations($resource, $scope->resolvedRelationshipKeys());

        // We can only transform the resource data if we have some data to
        // transform ...
        if (($data = $resource->getData()) !== null) {
            // Build the data by recursively transforming each resource.
            if ($resource instanceof Collection) {
                $data = [];
                foreach ($resource as $itemData) {
                    $data[] = $this->transformData($scope, $itemData);
                }
            } elseif ($resource instanceof Item) {
                $data = $this->transformData($scope, $data);
            }
        }

        // Serialize the transformed data
        return $this->serialize($resource, $data);
    }
900735
public function scoped(Scope $scope)
	{
		if($scope instanceof Dependent)
		{
			$this->scope = NULL;
		}
		else
		{
			$this->scope = get_class($scope);
		}
		
		return $this;
	}
852015
public function setScope($scope)
    {
        if (!is_array($scope)) {
            throw new InvalidTypeException('Scope', 'array', gettype($scope));
        }

        $this->scope = $scope;
    }
48851
public function getScope($scope)
    {
        if (!isset($this->allScopes[$scope])) {
            throw new ApplicationException('No definition for scope ' . $scope);
        }

        return $this->allScopes[$scope];
    }
368588
public function push($scope)
    {
        if (! is_array($scope)) {
            $scope = func_get_args();
        }

        $this->scopes[] = $scope;

        return $this;
    }
224875
public function setScope($scope)
    {
        if (!is_array($scope)) {
            $this->_scope = explode(',', $scope);
        } else {
            $this->_scope = $scope;
        }

        return $this;
    }
879246
public function find($scope)
    {
        if (strpos($scope, '.') === false) {
            $scope = $scope.'.'.AnInflector::singularize($scope);
        }

        if (isset($this[$scope])) {
            return $this[$scope];
        }

        return;
    }
744558
public function next($scope, $name = null)
    {
        Argument::i()
            ->test(1, 'object')          //argument 1 must be an object
            ->test(2, 'string', 'null'); //argument 2 must be a string or null

        $this->scope = $scope;
        $this->name = $name;

        return $this;
    }
263826
public function checkScope($scope)
  {
      if ($this->OAuthResponse) {
          return $this->OAuthResponse->hasScope($scope);
      }

      return in_array($scope, $this->getScope());
  }
1023653
public function setScopes(array $scopes = null)
    {
        ValidationUtility::ensureNullOrArrayOfString('$scopes', $scopes);

        $this->scopes = $scopes;

        return $this;
    }
306301
public function setScope($scope)
    {
        if (!in_array($scope, self::SCOPE_ALL, true)) {
            throw new InvalidArgumentException();
        }

        if (is_array($scope)) {
            $this->scope = $scope;
        }

        $this->scope[] = $scope;

        return $this;
    }