function Graph::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Component/Graph/Graph.php \Drupal\Component\Graph\Graph::__construct()
  2. 8.9.x core/lib/Drupal/Component/Graph/Graph.php \Drupal\Component\Graph\Graph::__construct()
  3. 10 core/lib/Drupal/Component/Graph/Graph.php \Drupal\Component\Graph\Graph::__construct()

Instantiates the directed acyclic graph object.

Parameters

array $graph: A three-dimensional associative array, with the first keys being the names of the vertices, which can be strings or numbers. The second key is 'edges', whose value is an array keyed by the names of the vertices connected to it; the values in this array can be simply TRUE or may contain other data.

File

core/lib/Drupal/Component/Graph/Graph.php, line 46

Class

Graph
Directed acyclic graph manipulation.

Namespace

Drupal\Component\Graph

Code

public function __construct($graph) {
    $this->graph = $graph;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.