function FieldStorageConfig::__sleep

Same name in other branches
  1. 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::__sleep()
  2. 8.9.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::__sleep()
  3. 10 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::__sleep()

Implements the magic __sleep() method.

Using the Serialize interface and serialize() / unserialize() methods breaks entity forms in PHP 5.4. @todo Investigate in https://www.drupal.org/node/1977206.

Overrides ConfigEntityBase::__sleep

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 754

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public function __sleep() : array {
    // Only serialize necessary properties, excluding those that can be
    // recalculated.
    $properties = get_object_vars($this);
    unset($properties['schema'], $properties['propertyDefinitions'], $properties['original']);
    return array_keys($properties);
}

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