Page MenuHomestyx hydra

PhabricatorEdgeGraph.php
No OneTemporary

PhabricatorEdgeGraph.php

<?php
final class PhabricatorEdgeGraph extends AbstractDirectedGraph {
private $edgeType;
public function setEdgeType($edge_type) {
$this->edgeType = $edge_type;
return $this;
}
protected function loadEdges(array $nodes) {
if (!$this->edgeType) {
throw new Exception(pht('Set edge type before loading graph!'));
}
$edges = id(new PhabricatorEdgeQuery())
->withSourcePHIDs($nodes)
->withEdgeTypes(array($this->edgeType))
->execute();
$results = array_fill_keys($nodes, array());
foreach ($edges as $src => $types) {
foreach ($types as $type => $dsts) {
foreach ($dsts as $dst => $edge) {
$results[$src][] = $dst;
}
}
}
return $results;
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Dec 3, 6:05 PM (2 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
433844
Default Alt Text
PhabricatorEdgeGraph.php (755 B)

Event Timeline