| 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 | $shortestPath = $this->dijkstra->shortestPaths($start, $end); |
||
| 33 | $prevRelations = $this->map[$start]['relations']; |
||
| 34 | |||
| 35 | $this->path = '_embedded'; |
||
| 36 | |||
| 37 | foreach ($shortestPath[0] as $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 |