You are here

protected function DefaultsSectionStorage::getRouteParameters in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage::getRouteParameters()
  2. 9 core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage::getRouteParameters()

Provides the route parameters needed to generate a URL for this object.

Return value

mixed[] An associative array of parameter names and values.

File

core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php, line 135

Class

DefaultsSectionStorage
Defines the 'defaults' section storage type.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

protected function getRouteParameters() {
  $display = $this
    ->getDisplay();
  $entity_type = $this->entityTypeManager
    ->getDefinition($display
    ->getTargetEntityTypeId());
  $bundle_parameter_key = $entity_type
    ->getBundleEntityType() ?: 'bundle';
  return [
    $bundle_parameter_key => $display
      ->getTargetBundle(),
    'view_mode_name' => $display
      ->getMode(),
  ];
}