View::addCacheMetadata

protected View::addCacheMetadata() Fills in the cache metadata of this view. Cache metadata is set per view and per display, and ends up being stored in the view's configuration. This allows Views to determine very efficiently: the max-age the cache contexts the cache tags In other words: this allows us to do the (expensive) work of initializing Views plugins and handlers to determine their effect on the cacheability of a view at save time rather than at runtime. File core/modules/views/src/E

View::addDisplay

public View::addDisplay($plugin_id = 'page', $title = NULL, $id = NULL) Adds a new display handler to the view, automatically creating an ID. Parameters string $plugin_id: (optional) The plugin type from the Views plugin annotation. Defaults to 'page'. string $title: (optional) The title of the display. Defaults to NULL. string $id: (optional) The ID to use, e.g., 'default', 'page_1', 'block_2'. Defaults to NULL. Return value string|bool The key to the display in $view->display, or FALSE i

View::calculateDependencies

public View::calculateDependencies() Calculates dependencies and stores them in the dependency property. Return value $this Overrides ConfigEntityBase::calculateDependencies See also \Drupal\Core\Config\Entity\ConfigDependencyManager File core/modules/views/src/Entity/View.php, line 269 Class View Defines a View configuration entity class. Namespace Drupal\views\Entity Code public function calculateDependencies() { parent::calculateDependencies(); // Ensure that the view is depe

View::createDuplicate

public View::createDuplicate() Creates a duplicate of the entity. Return value static A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system. Overrides ConfigEntityBase::createDuplicate File core/modules/views/src/Entity/View.php, line 132 Class View Defines a View configuration entity class. Namespace Drupal\views\Entity Code public function createDuplicate() { $duplicate = parent::createDuplicate(); unset($duplicate->executable)

View::duplicateDisplayAsType

public View::duplicateDisplayAsType($old_display_id, $new_display_type) 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/src/Entity/View.php, line 237 Cla

View::generateDisplayId

protected View::generateDisplayId($plugin_id) Generates a display ID of a certain plugin type. Parameters string $plugin_id: Which plugin should be used for the new display ID. Return value string File core/modules/views/src/Entity/View.php, line 208 Class View Defines a View configuration entity class. Namespace Drupal\views\Entity Code protected function generateDisplayId($plugin_id) { // 'default' is singular and is unique, so just go with 'default' // for it. For all others,

View::getDisplay

public &View::getDisplay($display_id) Retrieves a specific display's configuration by reference. Parameters string $display_id: The display ID to retrieve, e.g., 'default', 'page_1', 'block_2'. Return value array A reference to the specified display configuration. Overrides ViewEntityInterface::getDisplay File core/modules/views/src/Entity/View.php, line 230 Class View Defines a View configuration entity class. Namespace Drupal\views\Entity Code public function &getDisplay($d

View::getExecutable

public View::getExecutable() Gets an executable instance for this view. Return value \Drupal\views\ViewExecutable A view executable instance. Overrides ViewEntityInterface::getExecutable File core/modules/views/src/Entity/View.php, line 120 Class View Defines a View configuration entity class. Namespace Drupal\views\Entity Code public function getExecutable() { // Ensure that an executable View is available. if (!isset($this->executable)) { $this->executable = Views::exe

View::getInfo

public View::getInfo() Returns the element properties for this element. Return value array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format. Overrides ElementInterface::getInfo File core/modules/views/src/Element/View.php, line 18 Class View Provides a render element to display a view. Namespace Drupal\views\Element Code public function getInfo() {

View::invalidateCaches

public View::invalidateCaches() Invalidates cache tags. File core/modules/views/src/Entity/View.php, line 465 Class View Defines a View configuration entity class. Namespace Drupal\views\Entity Code public function invalidateCaches() { // Invalidate cache tags for cached rows. $tags = $this->getCacheTags(); \Drupal::service('cache_tags.invalidator')->invalidateTags($tags); }