public function FieldConfigBase::__sleep

public 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/2074253.

Overrides ConfigEntityBase::__sleep

File

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

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Field!FieldConfigBase.php/function/FieldConfigBase::__sleep/8.1.x