1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 10:18:48 +02:00
phorge-phorge/src/applications/celerity/CelerityResourceGraph.php

33 lines
713 B
PHP
Raw Normal View History

<?php
final class CelerityResourceGraph extends AbstractDirectedGraph {
private $resourceGraph = array();
private $graphSet = false;
protected function loadEdges(array $nodes) {
if (!$this->graphSet) {
throw new Exception(
'Call setResourceGraph before loading the graph!'
);
}
$graph = $this->getResourceGraph();
$edges = array();
foreach ($nodes as $node) {
$edges[$node] = idx($graph, $node, array());
}
return $edges;
}
final public function setResourceGraph(array $graph) {
$this->resourceGraph = $graph;
$this->graphSet = true;
return $this;
}
private function getResourceGraph() {
return $this->resourceGraph;
}
}