19 declare(strict_types=1);
    55         $this->previous_steps = [];
    56         $this->remaining_steps = iterator_to_array($path->
steps());
    62         while (!$start_element->
isRoot()) {
    64             if (!isset($start_element)) {
    65                 throw new \ilMDPathException(
    66                     'Can not navigate on an invalid metadata set.'    85         if (empty($this->remaining_steps)) {
    90         $clone->elements = iterator_to_array($clone->bridge->getNextElementsByStep(
    91             $clone->remaining_steps[0],
    94         $clone->previous_steps[] = $clone->current_step;
    95         $clone->current_step = $clone->remaining_steps[0];
    96         array_shift($clone->remaining_steps);
   102         if(empty($this->previous_steps)) {
   105         $clone = clone $this;
   106         $clone->elements = iterator_to_array($clone->bridge->getParents(...$clone->elements));
   107         $next_step = array_pop($clone->previous_steps);
   108         array_unshift($clone->remaining_steps, $clone->current_step);
   109         $clone->current_step = $next_step;
   115         return count($this->previous_steps) > 0;
   120         return count($this->remaining_steps) > 0;
   134         $clone = clone $this;
   135         while ($next = $clone->nextStep()) {
   138         yield 
from $clone->elements();
   169         foreach ($this->
elements() as $element) {
   180         if (!$this->leads_to_one) {
   184             throw new \ilMDPathException(
   185                 'Path should lead to exactly one element but does not.'