public function Tour::getTips

Returns the tips for this tour.

Return value

array An array of tip plugins.

Overrides TourInterface::getTips

File

drupal/core/modules/tour/lib/Drupal/tour/Plugin/Core/Entity/Tour.php, line 105
Contains \Drupal\tour\Plugin\Core\Entity\Tour.

Class

Tour
Defines the configured tour entity.

Namespace

Drupal\tour\Plugin\Core\Entity

Code

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