You are here

public function UpdateManager::getDefinitions in Lightning Core 8.3

Same name and namespace in other branches
  1. 8.5 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getDefinitions()
  2. 8 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getDefinitions()
  3. 8.2 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getDefinitions()
  4. 8.4 src/UpdateManager.php \Drupal\lightning_core\UpdateManager::getDefinitions()

Returns all update definitions, optionally filtered by provider module.

Parameters

string $module: (optional) The machine name of the module by which to filter updates.

Return value

array[] The discovered update definitions.

2 calls to UpdateManager::getDefinitions()
UpdateManager::getAvailable in src/UpdateManager.php
Returns all available update definitions.
UpdateManager::getVersion in src/UpdateManager.php
Tries to determine the semantic version of a module.

File

src/UpdateManager.php, line 145

Class

UpdateManager

Namespace

Drupal\lightning_core

Code

public function getDefinitions($module = NULL) {
  $definitions = $this->discovery
    ->getDefinitions();
  ksort($definitions);
  if ($module) {
    $filter = function (array $definition) use ($module) {
      return $definition['provider'] === $module;
    };
    $definitions = array_filter($definitions, $filter);
  }
  return $definitions;
}