You are here

public function DependencyStack::getDependenciesByUuid in Dependency Calculation 8

Get a specific set of dependencies.

Parameters

string[] $dependencies: The list of dependencies, by uuid, to retrieve.

Return value

\Drupal\depcalc\DependentEntityWrapperInterface[] The dependencies.

Throws

\Exception

File

src/DependencyStack.php, line 146

Class

DependencyStack
The dependencies stack.

Namespace

Drupal\depcalc

Code

public function getDependenciesByUuid(array $dependencies) {
  $results = [];
  foreach ($dependencies as $uuid) {
    $dependency = $this
      ->getDependency($uuid);
    if (!$dependency) {
      throw new \Exception(sprintf("Missing Dependency requested: %s.", $uuid));
    }
    $results[$uuid] = $dependency;
  }
  return $results;
}