You are here

public function ViewUI::duplicateDisplayAsType in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::duplicateDisplayAsType()
  2. 9 core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::duplicateDisplayAsType()

Duplicates an existing display into a new display type.

For example clone to display a page display as a block display.

Parameters

string $old_display_id: The origin of the duplicated display.

string $new_display_type: The display type of the new display.

Return value

string The display ID of the new display.

Overrides ViewEntityInterface::duplicateDisplayAsType

File

core/modules/views_ui/src/ViewUI.php, line 1133

Class

ViewUI
Stores UI related temporary settings.

Namespace

Drupal\views_ui

Code

public function duplicateDisplayAsType($old_display_id, $new_display_type) {
  return $this->storage
    ->duplicateDisplayAsType($old_display_id, $new_display_type);
}