You are here

public function BackendPluginBase::__sleep in Search API 8

Implements the magic __sleep() method.

Prevents the server entity from being serialized.

Overrides DependencySerializationTrait::__sleep

1 call to BackendPluginBase::__sleep()
Database::__sleep in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Implements the magic __sleep() method.
1 method overrides BackendPluginBase::__sleep()
Database::__sleep in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Implements the magic __sleep() method.

File

src/Backend/BackendPluginBase.php, line 337

Class

BackendPluginBase
Defines a base class for backend plugins.

Namespace

Drupal\search_api\Backend

Code

public function __sleep() {
  if ($this->server) {
    $this->serverId = $this->server
      ->id();
  }
  $properties = array_flip(parent::__sleep());
  unset($properties['server']);
  unset($properties['logger']);
  return array_keys($properties);
}