public function ViewUI::cacheSet

Sets a cached view object in the user tempstore.

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

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php, line 748
Definition of 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
    ->get('executable');
  if (isset($executable->current_display)) {

    // Add the knowledge of the changed display, too.
    $this->changed_display[$executable->current_display] = TRUE;
    unset($executable->current_display);
  }

  // Unset handlers; we don't want to write these into the cache.
  unset($executable->display_handler);
  unset($executable->default_display);
  $executable->query = NULL;
  unset($executable->displayHandlers);
  \Drupal::service('user.tempstore')
    ->get('views')
    ->set($this
    ->id(), $this);
}