3 namespace Drupal\views;
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
8 * Defines an interface for View storage classes.
10 interface ViewEntityInterface extends ConfigEntityInterface {
13 * Gets an executable instance for this view.
15 * @return \Drupal\views\ViewExecutable
16 * A view executable instance.
18 public function getExecutable();
21 * Retrieves a specific display's configuration by reference.
23 * @param string $display_id
24 * The display ID to retrieve, e.g., 'default', 'page_1', 'block_2'.
27 * A reference to the specified display configuration.
29 public function &getDisplay($display_id);
32 * Add defaults to the display options.
34 public function mergeDefaultDisplaysOptions();
37 * Duplicates an existing display into a new display type.
39 * For example clone to display a page display as a block display.
41 * @param string $old_display_id
42 * The origin of the duplicated display.
43 * @param string $new_display_type
44 * The display type of the new display.
47 * The display ID of the new display.
49 public function duplicateDisplayAsType($old_display_id, $new_display_type);
52 * Adds a new display handler to the view, automatically creating an ID.
54 * @param string $plugin_id
55 * (optional) The plugin type from the Views plugin annotation. Defaults to
57 * @param string $title
58 * (optional) The title of the display. Defaults to NULL.
60 * (optional) The ID to use, e.g., 'default', 'page_1', 'block_2'. Defaults
64 * The key to the display in $view->display, or FALSE if no plugin ID was
67 public function addDisplay($plugin_id = 'page', $title = NULL, $id = NULL);