Sets a cached view object in the user tempstore.
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);
}