Set the current scope

@param  string $scope    (See ScopeInterface::SCOPE_*)

@return $this

@throws Exception\Scope  When the scope does not exists
324047
public function setScope($scope)
    {
        if (in_array($scope, $this->scopes) === false) {
            throw Exception\Scope::invalidScope($scope, $this->scopes);
        }

        $this->scope = $scope;

        return $this;
    }
319586
public function scope($scope)
	{
		$scope = (new Scope())->scope($scope);

		$this->scopes[] = $scope;
		return $scope;
	}
1099204
public function setScope($scope)
    {
        if (in_array($scope, TableCellScope::asArray(), true) === true || $scope === -1) {
            $this->scope = $scope;
        } else {
            $msg = "The 'scope' argument must be a value from the TableCellScope enumeration, '" . $scope . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
383295
public function setScope(?string $value) : Log
    {

        if ($this->data['scope'] !== $value) {
            $this->data['scope'] = $value;
            $this->setModified('scope');
        }

        return $this;
    }
265938
public function update(ScopeInterface $scope): void
    {
        try {
            $now    = $this->ignoreException(function (): DateTimeImmutable {
                return new DateTimeImmutable();
            });
            $schema = $this->getDatabaseSchema();
            $this->updateResource($scope->getIdentifier(), [
                $schema->getScopesDescriptionColumn() => $scope->getDescription(),
                $schema->getScopesUpdatedAtColumn()   => $now,
            ]);
            $scope->setUpdatedAt($now);
        } catch (RepositoryException $exception) {
            $message = 'Scope update failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
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;
    }
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;
    }
1154262
public void setScope(String scope) {
        SystemAssert.requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty.");
        this.scope = scope;
    }
1082569
public function hasScope($scope)
    {
        if (is_array($scope)) {
            foreach ($scope as $s) {
                if ($this->hasScope($s) === false) {
                    return false;
                }
            }

            return true;
        }

        return $this->getAccessToken()->hasScope($scope);
    }
965157
public function scope(string $scope, ...$arguments)
	{
		$this->model->{Str::underscored2camel($scope) . 'Scope'}(...array_merge([$this], $arguments));

		return $this;
	}
67346
public function removeScope($scope)
    {
        $this->scopes = array_diff($this->scopes, [ $scope ]);

        unset($this->scopeParameters[ $scope ]);

        $this->refreshSettingDependentCriteria();
        return $this;
    }
423322
public function scope($scope)
    {
        $beforeMethod = 'before'.ucfirst($scope);
        $afterMethod  = 'after'.ucfirst($scope);
        if ( method_exists($this, $beforeMethod) )
        {
            call_user_func([$this,$beforeMethod]);
        }
        $this->rules = $this->resolveScope($scope);
        $this->attributes = $this->resolveAttributes($scope);
        $this->messages = $this->resolveMessages($scope);


        if ( method_exists($this, $afterMethod) )
        {
            call_user_func([$this,$afterMethod]);
        }

        return $this;
    }
403125
public function scope(...$scopes): self
    {
        $this->scopes = \array_merge($this->scopes, $scopes);

        return $this;
    }
900735
public function scoped(Scope $scope)
	{
		if($scope instanceof Dependent)
		{
			$this->scope = NULL;
		}
		else
		{
			$this->scope = get_class($scope);
		}
		
		return $this;
	}
875876
public function addScope($scope)
    {
        if (!in_array($scope, $this->scopes)) {
            $this->scopes[] = $scope;
        }

        return $this;
    }
566674
public function scope(Scope $scope)
    {
        $callable = $scope->getQuery();

        if (is_string($callable)) {
            /*
             * Adds a Class "ClassName::class" syntax.
             *
             * @note In this case Query class should implement Contracts\Module\Queryable interface.
             * @example: (new Scope('name'))->setQuery(Queryable::class);
             */
            if (class_exists($callable)) {
                $object = app($callable);

                if (!method_exists($object, 'query')) {
                    throw new \Terranet\Administrator\Exception(
                        sprintf(
                            'Query object %s should implement %s interface',
                            get_class($object),
                            \Terranet\Administrator\Contracts\Module\Queryable::class
                        )
                    );
                }

                $this->query = $object->query($this->query);

                return $this;
            }

            /*
             * Allows "SomeClass@method" syntax.
             *
             * @example: (new Scope('name'))->addQuery("User@active")
             */
            if (str_contains($callable, '@')) {
                list($object, $method) = explode('@', $callable);

                $this->query = app($object)->$method($this->query);

                return $this;
            }
        }

        /*
         * Allows adding a \Closure as a query;
         *
         * @example: (new Scope('name'))->setQuery(function($query) { return $this->modify(); })
         */
        if ($callable instanceof Closure) {
            $this->query = $callable($this->query);

            return $this;
        }

        /*
         * Accepts callable builder
         *
         * @example: (new Scope('name'))->setQuery([SomeClass::class, "queryMethod"]);
         */
        if (is_callable($callable)) {
            list($object, $method) = $callable;

            if (is_string($object)) {
                $object = app($object);
            }

            // Call Model Scope immediately when detected.
            //
            // @note: We don't use call_user_func_array() here
            // because of missing columns in returned query.
            $this->query = with(
                $this->model->is($object) ? $this->query : $object
            )->{$method}($this->query);
        }

        return $this;
    }
325866
public function setScope(string $value) : Setting
    {

        if ($this->data['scope'] !== $value) {
            $this->data['scope'] = $value;
            $this->setModified('scope');
        }

        return $this;
    }