function hook_tour_presave

Act on a tour being inserted or updated.

This hook is invoked before the tour object is saved to configuration.

Parameters

\Drupal\tour\Plugin\Core\Entity\Tour $entity: The tour object.

See also

hook_tour_insert()

hook_tour_update()

1 function implements hook_tour_presave()

File

drupal/core/modules/tour/tour.api.php, line 62
Describes API functions for tour module.

Code

function hook_tour_presave($entity) {
  if ($entity
    ->id() == 'tour-entity-create-test-en') {
    $entity
      ->set('label', $entity
      ->label() . ' alter');
  }
}