function FieldConfigBase::__sleep

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

1 call to FieldConfigBase::__sleep()
BaseFieldOverride::__sleep in core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php
Implements the magic __sleep() method.
1 method overrides FieldConfigBase::__sleep()
BaseFieldOverride::__sleep in core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php
Implements the magic __sleep() method.

File

core/lib/Drupal/Core/Field/FieldConfigBase.php, line 473

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

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

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