function public function Theme::getPendingUpdates

8.x-3.x Theme.php public Theme::getPendingUpdates()

Retrieves pending updates for the theme.

Return value

\Drupal\bootstrap\Plugin\Update\UpdateInterface[] An array of update plugin objects.

Class

Theme
Defines a theme object.

Namespace

Drupal\bootstrap

Source src/Theme.php (line 495)

public function getPendingUpdates() {
  $pending = [];

  // Only continue if the theme is Bootstrap based.
  if ($this->isBootstrap()) {
    $current_theme = $this->getName();
    $schemas = $this->getSetting('schemas', []);
    foreach ($this->getAncestry() as $ancestor) {
      $ancestor_name = $ancestor->getName();
      if (!isset($schemas[$ancestor_name])) {
        $schemas[$ancestor_name] = \Drupal::CORE_MINIMUM_SCHEMA_VERSION;
        $this->setSetting('schemas', $schemas);
      }
      $pending_updates = $ancestor->getUpdateManager()->getPendingUpdates($current_theme === $ancestor_name);
      foreach ($pending_updates as $schema => $update) {
        if ((int) $schema > (int) $schemas[$ancestor_name]) {
          $pending[] = $update;
        }
      }
    }
  }

  return $pending;
}