You are here

public function AppController::listAppsByStatus in Apigee Edge 8

File

src/Entity/Controller/AppController.php, line 194

Class

AppController
Definition of the App controller service.

Namespace

Drupal\apigee_edge\Entity\Controller

Code

public function listAppsByStatus(string $status, bool $include_credentials = TRUE, PagerInterface $pager = NULL) : array {
  $apps_from_cache = $this
    ->getAppsFromCacheByStatus($status, $pager);
  if ($apps_from_cache !== NULL) {
    return $apps_from_cache;
  }
  $apps = $this
    ->decorated()
    ->listAppsByStatus($status, $include_credentials, $pager);

  // Nice to have, after we have added cache support for methods that return
  // app ids then we can compare the list of returned apps here
  // and the already cached app ids per owner to call saveEntities()
  // if we have cached all apps of a developer/company here.
  $this->appCache
    ->saveEntities($apps);
  return $apps;
}