Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DataPart.php

function DataPart::__wakeup

Overrides TextPart::__wakeup

1 method overrides DataPart::__wakeup()
MessagePart::__wakeup in vendor/symfony/mime/Part/MessagePart.php

File

vendor/symfony/mime/Part/DataPart.php, line 147

Class

DataPart
@author Fabien Potencier <fabien@symfony.com>

Namespace

Symfony\Component\Mime\Part

Code

public function __wakeup() : void {
    $r = new \ReflectionProperty(AbstractPart::class, 'headers');
    $r->setValue($this, $this->_headers);
    unset($this->_headers);
    if (!\is_array($this->_parent)) {
        throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__);
    }
    foreach ([
        'body',
        'charset',
        'subtype',
        'disposition',
        'name',
        'encoding',
    ] as $name) {
        if (null !== $this->_parent[$name] && !\is_string($this->_parent[$name]) && !$this->_parent[$name] instanceof File) {
            throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__);
        }
        $r = new \ReflectionProperty(TextPart::class, $name);
        $r->setValue($this, $this->_parent[$name]);
    }
    unset($this->_parent);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal