You are here

public function ViewUI::cacheSet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/ViewUI.php \Drupal\views_ui\ViewUI::cacheSet()

Sets a cached view object in the user 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 895
Contains \Drupal\views_ui\ViewUI.

Class

ViewUI
Stores UI related temporary settings.

Namespace

Drupal\views_ui

Code

public function cacheSet() {
  if ($this
    ->isLocked()) {
    drupal_set_message(t('Changes cannot be made to a locked view.'), 'error');
    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('user.shared_tempstore')
    ->get('views')
    ->set($this
    ->id(), $this);
}