function ViewUI::duplicateDisplayAsType

Same name and namespace in other branches
  1. 8.9.x core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::duplicateDisplayAsType()
  2. 10 core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::duplicateDisplayAsType()
  3. 11.x 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 1143

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.