Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewUI.php

function ViewUI::cacheSet

Sets a cached view object in the shared tempstore.

3 calls to ViewUI::cacheSet()
ViewUI::standardCancel in core/modules/views_ui/src/ViewUI.php
Submit handler for cancel button.
ViewUI::standardSubmit in core/modules/views_ui/src/ViewUI.php
Basic submit handler applicable to all 'standard' forms.
ViewUI::submitItemAdd in core/modules/views_ui/src/ViewUI.php
Submit handler for adding new item(s) to a view.

File

core/modules/views_ui/src/ViewUI.php, line 875

Class

ViewUI
Stores UI related temporary settings.

Namespace

Drupal\views_ui

Code

public function cacheSet() {
    if ($this->isLocked()) {
        \Drupal::messenger()->addError(t('Changes cannot be made to a locked view.'));
        return;
    }
    // Let any future object know that this view has changed.
    $this->changed = TRUE;
    $executable = $this->getExecutable();
    if (isset($executable->current_display)) {
        // Add the knowledge of the changed display, too.
        $this->changed_display[$executable->current_display] = TRUE;
        $executable->current_display = NULL;
    }
    // Unset handlers. We don't want to write these into the cache.
    $executable->display_handler = NULL;
    $executable->default_display = NULL;
    $executable->query = NULL;
    $executable->displayHandlers = NULL;
    \Drupal::service('tempstore.shared')->get('views')
        ->set($this->id(), $this);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal