You are here

public function SavedSearchType::__sleep in Search API Saved Searches 8

Implements the magic __sleep() method.

Prevents the instantiated plugins from being serialized.

Overrides ConfigEntityBase::__sleep

File

src/Entity/SavedSearchType.php, line 672

Class

SavedSearchType
Provides an entity type for configuring how searches can be saved.

Namespace

Drupal\search_api_saved_searches\Entity

Code

public function __sleep() {

  // First, write any plugin changes to the persistent properties so they
  // won't be discarded.
  $this
    ->writeChangesToSettings();

  // Then, return a list of all properties that don't contain objects.
  $properties = get_object_vars($this);
  unset($properties['notificationPluginInstances']);
  return array_keys($properties);
}