annotate core/modules/views/src/ViewEntityInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\views;
Chris@0 4
Chris@0 5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Defines an interface for View storage classes.
Chris@0 9 */
Chris@0 10 interface ViewEntityInterface extends ConfigEntityInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Gets an executable instance for this view.
Chris@0 14 *
Chris@0 15 * @return \Drupal\views\ViewExecutable
Chris@0 16 * A view executable instance.
Chris@0 17 */
Chris@0 18 public function getExecutable();
Chris@0 19
Chris@0 20 /**
Chris@0 21 * Retrieves a specific display's configuration by reference.
Chris@0 22 *
Chris@0 23 * @param string $display_id
Chris@0 24 * The display ID to retrieve, e.g., 'default', 'page_1', 'block_2'.
Chris@0 25 *
Chris@0 26 * @return array
Chris@0 27 * A reference to the specified display configuration.
Chris@0 28 */
Chris@0 29 public function &getDisplay($display_id);
Chris@0 30
Chris@0 31 /**
Chris@0 32 * Add defaults to the display options.
Chris@0 33 */
Chris@0 34 public function mergeDefaultDisplaysOptions();
Chris@0 35
Chris@0 36 /**
Chris@0 37 * Duplicates an existing display into a new display type.
Chris@0 38 *
Chris@0 39 * For example clone to display a page display as a block display.
Chris@0 40 *
Chris@0 41 * @param string $old_display_id
Chris@0 42 * The origin of the duplicated display.
Chris@0 43 * @param string $new_display_type
Chris@0 44 * The display type of the new display.
Chris@0 45 *
Chris@0 46 * @return string
Chris@0 47 * The display ID of the new display.
Chris@0 48 */
Chris@0 49 public function duplicateDisplayAsType($old_display_id, $new_display_type);
Chris@0 50
Chris@0 51 /**
Chris@0 52 * Adds a new display handler to the view, automatically creating an ID.
Chris@0 53 *
Chris@0 54 * @param string $plugin_id
Chris@0 55 * (optional) The plugin type from the Views plugin annotation. Defaults to
Chris@0 56 * 'page'.
Chris@0 57 * @param string $title
Chris@0 58 * (optional) The title of the display. Defaults to NULL.
Chris@0 59 * @param string $id
Chris@0 60 * (optional) The ID to use, e.g., 'default', 'page_1', 'block_2'. Defaults
Chris@0 61 * to NULL.
Chris@0 62 *
Chris@0 63 * @return string|bool
Chris@0 64 * The key to the display in $view->display, or FALSE if no plugin ID was
Chris@0 65 * provided.
Chris@0 66 */
Chris@0 67 public function addDisplay($plugin_id = 'page', $title = NULL, $id = NULL);
Chris@0 68
Chris@0 69 }