protected $scope = 'friends';
430409
protected function fetchAttributes() {
		$info = (array)$this->makeSignedRequest('https://api.vk.com/method/users.get.json', array(
			'query' => array(
				'uids' => $this->uid,
				//'fields' => '', // uid, first_name and last_name is always available
				'fields' => 'nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, photo_rec',
			),
		));

		$info = $info['response'][0];

		$this->attributes['id'] = $info->uid;
		$this->attributes['name'] = $info->first_name . ' ' . $info->last_name;
		$this->attributes['url'] = 'http://vk.com/id' . $info->uid;

		if (!empty($info->nickname)) {
			$this->attributes['username'] = $info->nickname;
		}
		else {
			$this->attributes['username'] = 'id' . $info->uid;
		}

		$this->attributes['gender'] = $info->sex == 1 ? 'F' : 'M';

		$this->attributes['city'] = $info->city;
		$this->attributes['country'] = $info->country;

		$this->attributes['timezone'] = timezone_name_from_abbr('', $info->timezone * 3600, date('I'));
		;

		$this->attributes['photo'] = $info->photo;
		$this->attributes['photo_medium'] = $info->photo_medium;
		$this->attributes['photo_big'] = $info->photo_big;
		$this->attributes['photo_rec'] = $info->photo_rec;
	}
79807
public function removeScope($scope)
    {
        $this->validateScopeValue($scope);

        $key = $this->getScopeKey($scope);
        if (false === $key) {
            return $this;
        }

        unset($this->descriptor['scopes'][$key]);
        return $this;
    }
402944
public function checkScope($scope)
	{
		if (isset($this->scopes[$scope])) {
			return $this->scopes[$scope];
		}
		
		if (!empty($this->scopes['*'])) {
			return true;
		}
		
		if (!$this->check()) {
			return false;
		}
		
		if ('user' == $this->type) {
			$this->scopes[$scope] = Authorizer::hasScope($scope);
		}
		else {
			$client = $this->client();
			$this->scopes[$scope] = in_array($scope, $client->scopes());
		}
		
		if (!$this->scopes[$scope] && '*' != $scope) {
			$this->scopes[$scope] = $this->checkScope('*');
		}
		
		return $this->scopes[$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);
        }
    }
1163761
public function addScope($scope)
  {
      if (!is_array($scope)) {
          $scope = explode(' ', $scope);
      }

      $this->scopes = array_unique(array_merge($this->scopes, $scope));

      return $this;
  }
1315088
function observe($scope, $attrs, key, defValue, callbackFunc) {
        if (callbackFunc === void 0) { callbackFunc = null; }
        $attrs.$observe(key, function (value) {
            if (!angular.isDefined(value)) {
                $scope[key] = defValue;
            }
            else {
                $scope[key] = value;
            }
            if (angular.isDefined(callbackFunc) && callbackFunc) {
                callbackFunc($scope[key]);
            }
        });
    }
291927
public function getDescriptionForScope($scope)
    {
        // Get Scope
        $scopeObject = $this->sm->findScopeByScope($scope);

        if (!$scopeObject) {
            return $scope;
        }

        return $scopeObject->getDescription();
    }
852015
public function setScope($scope)
    {
        if (!is_array($scope)) {
            throw new InvalidTypeException('Scope', 'array', gettype($scope));
        }

        $this->scope = $scope;
    }
325379
public function run_afters($scope) {    
    foreach ($this->_afters as $after) {
      $after($scope);
    }

    if ($this->_parent) {
      $this->_parent->run_afters($scope);
    }
  }
664240
public static function getSetting($scope, $key)
    {
        if (!count(self::$settings)) {
            self::load();
        }

        if (isset(self::$settings[$scope][$key])) {
            return self::$settings[$scope][$key];
        }

        return null;
    }
671334
public function canAccess(string $scope)
    {
        $scopes = func_get_args();
        $diff = array_diff($scopes, $this->scope);
        return count($diff)>0;
    }
474499
public function addScope($scope)
    {
        $this->validateScopeValue($scope);

        if (false !== $this->getScopeKey($scope)) {
            return $this;
        }

        $this->descriptor['scopes'][] = $scope;
        return $this;
    }
338935
public function restoreSorting(array $scope = []): void
    {
        $records = $this->_table->find()
            ->select([$this->_table->getPrimaryKey(), $this->getConfig('sortField')])
            ->select($this->getConfig('columnScope'))
            ->order($this->getConfig('defaultOrder'));

        if (!empty($scope)) {
            $records->where($scope);
        }

        $sorts = [];
        foreach ($records as $entity) {
            $individualScope = '';
            foreach ($this->getConfig('columnScope') as $column) {
                $individualScope .= $entity->get($column);
            }

            if (!isset($sorts[$individualScope])) {
                $sorts[$individualScope] = 0;
            }

            $sort = ++$sorts[$individualScope];
            $this->_table->updateAll([
                $this->getConfig('sortField') => $sort,
            ], [
                $this->_table->getPrimaryKey() => $entity->get($this->_table->getPrimaryKey()),
            ]);
        }
    }
952455
public function hasScope(string $scope): bool
    {
        // always return true if extensions not configured
        return !Group::create()->hasExtension(GroupExtension::class) || $this->getMember()->Groups()->filter([
            'Scopes.Name' => $scope
        ])->count() > 0;
    }
463177
private function figureOutWhichIncludes(Scope $scope)
    {
        $includes = $this->getDefaultIncludes();
        foreach ($this->getAvailableIncludes() as $include) {
            if ($scope->isRequested($include)) {
                $includes[] = $include;
            }
        }

        return $includes;
    }
215234
public function hasScope($scope)
    {
        if ($this->scopes === null) {
            $this->getScopes();
        }

        return isset($this->scopes[$scope]);
    }
320402
public function withoutGlobalScope($scope)
    {
        if (! is_string($scope)) {
            $scope = get_class($scope);
        }

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

        $this->removedScopes[] = $scope;

        return $this;
    }