You are here

public function ViewExecutable::__sleep in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::__sleep()

Magic method implementation to serialize the view executable.

Return value

array The names of all variables that should be serialized.

File

core/modules/views/src/ViewExecutable.php, line 2488

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function __sleep() {

  // Limit to only the required data which is needed to properly restore the
  // state during unserialization.
  $this->serializationData = [
    'storage' => $this->storage
      ->id(),
    'views_data' => $this->viewsData->_serviceId,
    'route_provider' => $this->routeProvider->_serviceId,
    'current_display' => $this->current_display,
    'args' => $this->args,
    'current_page' => $this->current_page,
    'exposed_input' => $this->exposed_input,
    'exposed_raw_input' => $this->exposed_raw_input,
    'exposed_data' => $this->exposed_data,
    'dom_id' => $this->dom_id,
    'executed' => $this->executed,
  ];
  return [
    'serializationData',
  ];
}