Set the account to be used when resoving configs.

@param string $account

@return self
347590
public function useAccount($account = null)
    {
        $account = $account ?: Core::instance()->getConfig('default');

        if (!Core::instance()->getConfig("accounts.{$account}")) {
            throw new Exception('Invalid account selected');
        }

        $this->account = $account;

        return $this;
    }
1318253
public function setConfigurator($configurator)
    {
        if (is_string($configurator) && strpos($configurator, '::') !== false) {
            $configurator = explode('::', $configurator, 2);
        }

        $this->configurator = $configurator;

        return $this;
    }
42551
protected function create($account, $config = array())
    {
        if(!isset($config['name']))
        {
            // This shouldn't happen anymore... but just in case, force it!
            $config['name'] = 't' . count($this->instances);
        }
        
        // Grab overall config options
        $debug = $this->debug;
        $autoPageview = $this->autoPageview;
        
        // Finally, make a new instance
        $this->instances[$config['name']] = new UniversalAnalyticsInstance($account, $config, $debug, $autoPageview);
        
        // Return the newly created instance
        return $this->instances[$config['name']];
    }
1127201
public function change(string $db): self
  {
    if ( $this->language->change($db) ){
      $this->current = $db;
    }
    return $this;
  }
473113
public function set(string $str): self
    {
        $this->str = $this->inputConv($str);

        return $this;
    }
1287289
public function setLogin($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->login !== $v) {
            $this->login = $v;
            $this->modifiedColumns[MapratingTableMap::COL_LOGIN] = true;
        }

        return $this;
    }
743472
public function updateAccount(Account $account)
    {
        $response = $this->rest->post(
            static::ACCOUNT_PATH,
            $account->toUpdateParams()
        );

        $this->checkResponse($response);

        return $account->fromResponse($response);
    }
207591
public function setEmail($email): User
    {
        if ($this->email !== $email) {
            $this->email = $email;

            DB::table('user')
                ->where('user_id', '=', $this->user_id)
                ->update([
                    'email' => $email,
                ]);
        }

        return $this;
    }
1284224
public function getAccountKey($key, $default = null, $account = null)
    {
        if (!$this->account || ($account && $account !== $this->account)) {
            $this->useAccount($account);
        }

        return Core::instance()->getConfig("accounts.{$this->account}.{$key}", $default);
    }
720982
public function setup(string $environment = null)
    {
        if (isset($this->initialized['setup'])) {
            return $this;
        }

        $this->initialized['setup'] = true;

        $this->measureTime('_setup', 'Site Setup', function () use ($environment) {
            // Force environment if passed to the method.
            if ($environment) {
                Setup::$environment = $environment;
            }

            $this['setup'];
            $this['streams'];
        });

        return $this;
    }
843874
public function set($name, $value): self
    {
        if (!\is_array($value)) {
            $value = ['value' => (string)$value];
        }

        parent::set($name, \array_replace($this->defaults, $value));

        return $this;
    }
28589
public function setEmail($email)
    {
        $email = is_null($email) ? '' : $email;
        parent::setEmail($email);
        $this->setUsername($email);

        return $this;
    }
840475
public function setAccountMembershipAttributeMappingType($accountMembershipAttributeMappingType)
    {
        Enum\AccountMembershipMappingType::throwExceptionIfInvalid($accountMembershipAttributeMappingType);

        $this->accountMembershipAttributeMappingType = $accountMembershipAttributeMappingType;
        $this->onConfigChanged();
    }
1254712
public function addAccount(ChartAccountsAccount $account) {
        foreach ($this->accounts as $current) {
            if ($current->getNumber() === $account->getNumber()) {
                throw new AccountAlreadyExistsException($account);
            }
        }
        $this->accounts[] = $account;
        return $this;
    }
1204141
public function setEmail($email)
    {
        $this->email = $email;
        $this->referenceId = null;
        $this->executed = false;
        return $this;
    }
1195322
public static function make($account = null, $clientId = null, $clientSecret = null)
    {
        return new static($account, $clientId, $clientSecret);
    }
632760
public static function authenticate($account = null)
    {
        $configs = (new ConfigurationRepository)->useAccount($account);
        $key = $configs->getAccountKey('key');
        $secret = $configs->getAccountKey('secret');
        $cacheKey = self::AC_TOKEN . "{$key}{$secret}";

        if ($token = Core::instance()->cache()->get($cacheKey)) {
            return $token;
        }

        try {
            $response = self::makeRequest($key, $secret, $account);
            $body = json_decode($response->getBody());
            self::saveCredentials($cacheKey, $body);

            return $body->access_token;
        } catch (RequestException $exception) {
            $message = $exception->getResponse() ?
               $exception->getResponse()->getReasonPhrase() :
               $exception->getMessage();

            throw self::generateException($message);
        }
    }