You are here

public function BackgroundImage::__sleep in Background Image 8

Same name and namespace in other branches
  1. 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::__sleep()
  2. 2.0.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::__sleep()

Overrides ContentEntityBase::__sleep

File

src/Entity/BackgroundImage.php, line 112

Class

BackgroundImage
Defines the Background Image entity.

Namespace

Drupal\background_image\Entity

Code

public function __sleep() {

  // Don't use unset() here because the magic method
  // \Drupal\Core\Entity\ContentEntityBase::__get can cause the value to be
  // set as a FieldItemList object. Instead, always explicitly set to NULL.
  $this->cssSelector = NULL;
  $this->settingsHash = NULL;
  $this->imageHash = NULL;
  $this->parent = NULL;
  $this->settings = NULL;
  return parent::__sleep();
}