19declare(strict_types=1);
35 $next = $position + 1;
36 if ($next >= 0 && $next < count($items)) {
37 return [$items[$next]];
49 $next = $position + 1;
50 if ($next >= 0 && $next < count($items)) {
51 return [$items[$next]];
63 $previous = $position - 1;
64 if ($previous >= 0 && $previous < count($items)) {
65 return [$items[$previous]];
139 foreach ($items as $index => $candidate) {
140 if ($candidate->getRefId() === $item->
getRefId()) {
144 throw new \Exception(
"This is not a valid item.", 1);
Provides index-based navigation through the items of a learning sequence.
getStructuralSuccessors(array $items, \LSItem $current)
canEnterIgnoringEdges(\LSLearnerItem $target)
Allows entering every item because linear navigation has no edge conditions.
canEnter(\LSLearnerItem $target)
Allows entering every item in linear navigation.
canEnterFrom(\LSLearnerItem $current, \LSLearnerItem $target)
Allows entering every target from every current item.
getPredecessors(array $items, \LSLearnerItem $current)
findPosition(array $items, \LSItem $item)
Finds the array index of an item by its reference identifier.
canLeave(\LSLearnerItem $current)
Allows leaving every item in linear navigation.
preload(array $items)
Does not preload data because linear navigation has no state to load.
getOutputConditionIds(\LSLearnerItem $item)
Returns no output-condition identifiers because linear navigation has no conditions.
getInputConditionIds(\LSLearnerItem $item)
Returns no input-condition identifiers because linear navigation has no conditions.
getSuccessors(array $items, \LSLearnerItem $current)
Data holding class LSItem .
Add learning progress and availability information to the LSItem.
Abstraction of the navigation between the objects of a learning sequence.