Drupal investigation

ViewEntityInterface.php 1.8KB

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