You are here

protected function ApiSync::loadFromCache in FormAssembly 8

Helper method to load a set of form and page count from cache.

Parameters

string $id: The cache id.

2 calls to ApiSync::loadFromCache()
ApiSync::getForms in src/ApiSync.php
Get data about available forms.
ApiSync::syncForms in src/ApiSync.php
Process form data from FormAssembly and perform CRUD ops as needed.

File

src/ApiSync.php, line 157

Class

ApiSync
Service class for FormAssembly API: Handles form sync.

Namespace

Drupal\formassembly

Code

protected function loadFromCache($id) {
  if (empty($id)) {

    // Nothing to cache.
    return;
  }
  $data = $this->cache
    ->get($id);
  if (!empty($data)) {
    $this->forms = $data->data['forms'];
    $this->page = $data->data['page'];
    $this->lastHash = $data->data['hash'];
  }
}