You are here

public function Tour::getTips in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/tour/src/Entity/Tour.php \Drupal\tour\Entity\Tour::getTips()
  2. 9 core/modules/tour/src/Entity/Tour.php \Drupal\tour\Entity\Tour::getTips()

Returns the tips for this tour.

Return value

array An array of tip plugins.

Overrides TourInterface::getTips

File

core/modules/tour/src/Entity/Tour.php, line 120

Class

Tour
Defines the configured tour entity.

Namespace

Drupal\tour\Entity

Code

public function getTips() {
  $tips = [];
  foreach ($this->tips as $id => $tip) {
    $tips[] = $this
      ->getTip($id);
  }
  uasort($tips, function ($a, $b) {
    return $a
      ->getWeight() <=> $b
      ->getWeight();
  });
  \Drupal::moduleHandler()
    ->alter('tour_tips', $tips, $this);
  return array_values($tips);
}