function Extension::__sleep

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__sleep()
  2. 8.9.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__sleep()
  3. 11.x 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 195

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.