mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
Update Graph.php
This commit is contained in:
parent
1bf1e6da3b
commit
65e0a5d024
|
|
@ -68,6 +68,8 @@ class Graph
|
||||||
*/
|
*/
|
||||||
public function addNodeRelative(Node $relative, Node $node) : Graph
|
public function addNodeRelative(Node $relative, Node $node) : Graph
|
||||||
{
|
{
|
||||||
|
$this->edges[] = new Edge($relative, $node);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -199,10 +201,6 @@ class Graph
|
||||||
*/
|
*/
|
||||||
public function getNeighbors($node) : array
|
public function getNeighbors($node) : array
|
||||||
{
|
{
|
||||||
if (!($node instanceof Node)) {
|
|
||||||
$node = $this->getNode($node);
|
|
||||||
}
|
|
||||||
|
|
||||||
$edges = $this->getEdgesOfNode($node);
|
$edges = $this->getEdgesOfNode($node);
|
||||||
$neighbors = [];
|
$neighbors = [];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user