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

Breadcrumb

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

class MessagePart

@final

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • class \Symfony\Component\Mime\Part\AbstractPart
    • class \Symfony\Component\Mime\Part\TextPart extends \Symfony\Component\Mime\Part\AbstractPart
      • class \Symfony\Component\Mime\Part\DataPart extends \Symfony\Component\Mime\Part\TextPart
        • class \Symfony\Component\Mime\Part\MessagePart extends \Symfony\Component\Mime\Part\DataPart

Expanded class hierarchy of MessagePart

1 file declares its use of MessagePart
DigestPart.php in vendor/symfony/mime/Part/Multipart/DigestPart.php

File

vendor/symfony/mime/Part/MessagePart.php, line 22

Namespace

Symfony\Component\Mime\Part
View source
class MessagePart extends DataPart {
    public function __construct(RawMessage $message) {
        if ($message instanceof Message) {
            $name = $message->getHeaders()
                ->getHeaderBody('Subject') . '.eml';
        }
        else {
            $name = 'email.eml';
        }
        parent::__construct('', $name);
    }
    public function getMediaType() : string {
        return 'message';
    }
    public function getMediaSubtype() : string {
        return 'rfc822';
    }
    public function getBody() : string {
        return $this->message
            ->toString();
    }
    public function bodyToString() : string {
        return $this->getBody();
    }
    public function bodyToIterable() : iterable {
        return $this->message
            ->toIterable();
    }
    public function __sleep() : array {
        return [
            'message',
        ];
    }
    public function __wakeup() : void {
        $this->__construct($this->message);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
AbstractPart::$headers private property
AbstractPart::getHeaders public function
AbstractPart::toIterable public function
AbstractPart::toString public function
DataPart::$cid private property
DataPart::$filename private property
DataPart::$mediaType private property
DataPart::$_parent protected property @internal
DataPart::asDebugString public function Overrides TextPart::asDebugString
DataPart::asInline public function
DataPart::fromPath public static function
DataPart::generateContentId private function
DataPart::getContentId public function
DataPart::getContentType public function
DataPart::getFilename public function
DataPart::getPreparedHeaders public function Overrides TextPart::getPreparedHeaders
DataPart::hasContentId public function
DataPart::setContentId public function
MessagePart::bodyToIterable public function Overrides TextPart::bodyToIterable
MessagePart::bodyToString public function Overrides TextPart::bodyToString
MessagePart::getBody public function Overrides TextPart::getBody
MessagePart::getMediaSubtype public function Overrides TextPart::getMediaSubtype
MessagePart::getMediaType public function Overrides DataPart::getMediaType
MessagePart::__construct public function Overrides DataPart::__construct
MessagePart::__sleep public function Overrides DataPart::__sleep
MessagePart::__wakeup public function Overrides DataPart::__wakeup
TextPart::$body private property @var resource|string|File
TextPart::$charset private property
TextPart::$disposition private property
TextPart::$encoders private static property
TextPart::$encoding private property
TextPart::$name private property
TextPart::$seekable private property
TextPart::$subtype private property
TextPart::$_headers protected property @internal
TextPart::addEncoder public static function
TextPart::chooseEncoding private function
TextPart::DEFAULT_ENCODERS private constant
TextPart::getDisposition public function
TextPart::getEncoder private function
TextPart::getName public function Gets the name of the file.
TextPart::setDisposition public function
TextPart::setName public function Sets the name of the file (used by FormDataPart).

API Navigation

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