Freshens the repository collection.

@return \React\Promise\Promise
331842
public function freshen()
    {
        if (! isset($this->endpoints['all'])) {
            return \React\Promise\reject(new \Exception('You cannot freshen this repository.'));
        }

        $deferred = new Deferred();

        $this->http->get(
            $this->replaceWithVariables(
                $this->endpoints['all']
            )
        )->then(function ($response) {
            $this->fill([]);

            foreach ($response as $value) {
                $value = array_merge($this->vars, (array) $value);
                $part = $this->factory->create($this->part, $value, true);

                $this->push($part);
            }
        }, function ($e) use ($deferred) {
            $deferred->reject($e);
        });
    }
877034
public function clear()
  {
    $this->_object = $this->_changed = $this->_operations = $this->_dirty = $this->_related_objects = array();
    $this->_loaded = NULL;
    return $this;
  }
165870
public function reset()
	{
		$this->sources      = array();
		$this->destinations = array();
		$this->removals     = array();
		$this->patches      = array();

		return $this;
	}
1263800
public function refresh() : self {
      $string = $this->assemble();
      $this->cleanCollection();

      $tokens = Helper::getTokensFromString($string);
      $this->setItems($tokens);

      $this->rewind();
      return $this;
    }
366426
public function load()
    {
        $this->checkSource();

        $this->spammers = $this->cacheSpammers(function () {
            return SpammerCollection::load(
                file($this->source, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
            );
        });

        return $this;
    }
94470
public function refresh() {

		$directory = new Directory($this -> directory -> getPath());
		$this -> directory = $directory -> entity();

		return $this;
	}
65966
protected function updateFilters()
    {
        $request = request();

        if ($request->filled('_clear')) {
            $this->filters = [];
            $resetPage = ! empty($this->filters);
        } else {
            $this->filters = $request->get('filter', []);
            $resetPage = true;
        }

        $this->storeFiltersInSession();

        if ($resetPage) {
            $this->markResetActivePage();
        }

        return $this;
    }
1031896
public function collection($fresh = FALSE)
  {
    if($fresh === TRUE)
    {
      if($this->name)
      {
        if ($this->db === NULL)
        {
          $this->db = Mongo_Database::$default;
        }
        return new Mongo_Collection($this->name, $this->db, $this->gridFS, get_class($this));
      }
      else
      {
        $class_name = $this->get_collection_class_name();
        return new $class_name(NULL, NULL, NULL, get_class($this));
      }
    }

    if($this->name)
    {
      $name = "$this->db.$this->name.$this->gridFS";
      if( ! isset(self::$collections[$name]))
      {
        if ($this->db === NULL)
        {
          $this->db = Mongo_Database::$default;
        }
        self::$collections[$name] = new Mongo_Collection($this->name, $this->db, $this->gridFS, get_class($this));
      }
      return self::$collections[$name];
    }
    else
    {
      $name = $this->get_collection_class_name();
      if( ! isset(self::$collections[$name]))
      {
        self::$collections[$name] = new $name(NULL, NULL, NULL, get_class($this));
      }
      return self::$collections[$name];
    }
  }
546993
public function vault()
    {
        $vault = collect($this->dock)->where('name', 'vault')->first();
        $vault->bucket = $this;
        return new Vault($vault);
    }
1317991
public function executeAll()
    {
        $repository = $this->repository;

        $entity = $this->entity;

        $prepare = $repository->prepareQuery($entity->getQuery(), $entity->getRecordClass());

        $measure = str_replace("\n", " ", $prepare->queryString);
        $hash = sha1($measure . microtime());

        startMeasure('Executing ' . $measure);
        $execute = $repository->executePrepared($prepare);
        stopMeasure('Executing ' . $measure);

        if (!$execute) {
            return new Collection();
        }

        $results = $repository->fetchAllPrepared($prepare);

        if (!$results) {
            return new Collection();
        }

        $collection = new Collection($results);
        if ($entity->getQuery()->isCounted()) {
            startMeasure('Counting ' . $hash);
            $prepareCount = $repository->prepareSQL('SELECT FOUND_ROWS()');
            $repository->executePrepared($prepareCount);
            $collection->setTotal($prepareCount->fetch(PDO::FETCH_COLUMN));
            $entity->count(false);
            stopMeasure('Counting ' . $hash);
        }

        startMeasure('Setting original ' . $hash);
        $collection->setEntity($entity)->setSaved()->setOriginalFromData();
        stopMeasure('Setting original ' . $hash);

        startMeasure('Filling relations ' . $hash);
        $filled = $entity->fillCollectionWithRelations($collection);
        stopMeasure('Filling relations ' . $hash);

        return $filled;
    }
235758
public function refreshAccessToken()
	{
		$newToken = $this->http->requestAccessToken();
		if (!is_null($newToken))
		{
			$this->config->setAccessToken($newToken);
			$this->http = new Request($this->guzzle, $this->config, $this->climate);
			if ($this->config->shouldStoreToken())
			{
				file_put_contents(Helper::getStoragePath($this->config->getStorageTokenFilename()), $newToken);
			}
		}

		return $newToken;
	}
495225
public function promise()
    {
        // If the promise has been created, just return it.
        if (!$this->promise) {
            // Create an upload/download promise for the transfer.
            $this->promise = $this->sourceMetadata['scheme'] === 'file'
                ? $this->createUploadPromise()
                : $this->createDownloadPromise();
        }

        return $this->promise;
    }
1273897
function commit(): \React\Promise\PromiseInterface {
        return $this->query('COMMIT')->then(function () {
            $this->driver->endTransaction();
            $this->client->checkinConnection($this->driver);
            $this->driver = null;
        });
    }
174122
public function rollback()
    {
        parent::rollback();
        foreach ($this->getOriginalAll() as $collection) {
            if ($collection instanceof Collection) {
                $collection->rollback();
            }
        }
        return $this;
    }
5111
public function open(): Promise
    {
        return $this->pending = call(function () {
            if ($this->pending) {
                yield $this->pending;
            }

            if ($this->id === null) {
                $this->id = yield $this->storage->create();
            } else {
                $this->data = yield $this->storage->lock($this->id);
            }

            ++$this->openCount;

            $this->status = self::STATUS_READ | self::STATUS_LOCKED;

            return $this;
        });
    }
53617
public function refresh()
    {
        $query = [
            'appid' => $this->appid,
            'grant_type' => 'refresh_token',
            'refresh_token' => $this['refresh_token'],
        ];

        $response = Http::request('GET', static::REFRESH)
            ->withQuery($query)
            ->send();

        if (0 != $response['errcode']) {
            throw new \Exception($response['errmsg'], $response['errcode']);
        }

        // update new access_token from ArrayCollection
        parent::__construct($response->toArray());

        return $this;
    }
51250
public function refresh() : self {
      $newCode = $this->collection->assemble();
      $tokens = Helper::getTokensFromString($newCode);

      $this->collection->setItems($tokens);
      return $this;
    }