Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function buildPathBetween($start, $end) : bool |
||
29 | { |
||
30 | $this->builder->rebuildRelationMap(); |
||
31 | |||
32 | $percorso = $tutta = $this->dijkstra->shortestPaths($start, $end); |
||
|
|||
33 | $prevRelations = $this->map[$start]['relations']; |
||
34 | |||
35 | $this->path = '_embedded'; |
||
36 | |||
37 | foreach ($percorso[0] as $nodo => $meta) { |
||
38 | if ($relationName = array_search($meta, $prevRelations)) { |
||
39 | $this->path .= '.' . $relationName; |
||
40 | } |
||
41 | |||
42 | $prevRelations = $this->map[$meta]['relations']; |
||
43 | } |
||
44 | |||
45 | return true; |
||
46 | } |
||
66 |