You are here

public function Extension::__sleep in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__sleep()

Magic method implementation to serialize the extension object.

Return value

array The names of all variables that should be serialized.

File

core/lib/Drupal/Core/Extension/Extension.php, line 171

Class

Extension
Defines an extension (file) object.

Namespace

Drupal\Core\Extension

Code

public function __sleep() {

  // @todo \Drupal\Core\Extension\ThemeExtensionList is adding custom
  //   properties to the Extension object.
  $properties = get_object_vars($this);

  // Don't serialize the app root, since this could change if the install is
  // moved. Don't serialize splFileInfo because it can not be.
  unset($properties['splFileInfo'], $properties['root']);
  return array_keys($properties);
}