Most basic representation of a single part of an email.

public __construct(ZBateson\MailMimeParser\Message\PartStreamContainer $streamContainer, ?ZBateson\MailMimeParser\Message\IMimePart $parent = NULL)
public __toString() : string
public attach(SplObserver $observer) : void
public attachContentStream(Psr\Http\Message\StreamInterface $stream, string $streamCharset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
  • return static
public detach(SplObserver $observer) : void
public detachContentStream()
  • return static
public getBinaryContentResourceHandle()
public getBinaryContentStream()
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getCharset() : ?string

Returns the charset of the content, or null if not applicable/defined.

  • return string|null the charset
public getContent(string $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET) : ?string
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentDisposition(?string $default = NULL) : ?string

Returns the content's disposition, or returns the value of $default if
not defined.

  • param string $default Optional default value to return if not
  • return string|null the disposition.
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentId() : ?string

Returns the Content ID of the part, or null if not defined.

  • return string|null the content ID.
public getContentStream(string $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentTransferEncoding(?string $default = NULL) : ?string

Returns the content transfer encoding used to encode the content on this
part, or the value of $default if not defined.

  • param $default Optional default value to return if not
  • return string|null the transfer encoding defined for the part.
public abstract ZBateson\MailMimeParser\Message\IMessagePart::getContentType(string $default = 'text/plain') : ?string

Returns the mime type of the content, or $default if one is not set.

  • param string $default Optional override for the default return value of
  • return string the mime type
public getFilename() : ?string
public getParent()
public getResourceHandle()
public getStream()
public hasContent() : bool
public abstract ZBateson\MailMimeParser\Message\IMessagePart::isMime() : bool

Returns true if the current part is a mime part.

public abstract ZBateson\MailMimeParser\Message\IMessagePart::isTextPart() : bool

Returns true if the content of this part is plain text.

public notify() : void
public save( $filenameResourceOrStream, string $filemode = 'w+')
  • return static
public saveContent( $filenameResourceOrStream) : self
public setCharsetOverride(string $charsetOverride, bool $onlyIfNoCharset = false)
  • return static
public setContent( $resource, string $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
  • return static
protected $charsetOverride = NULL
  • var ?string can be used to set an override for content's charset in cases
    where a user knows the charset on the content is not what it claims
    to be.
protected $ignoreTransferEncoding = NULL
  • var bool set to true when a user attaches a stream manually, it's
    assumed to already be decoded or to have relevant transfer encoding
    decorators attached already.
protected $observers = NULL
  • var \SplObjectStorage attached observers that need to be notified of
    modifications to this part.
protected $parent = NULL
  • var ?\IMimePart parent part
protected $partStreamContainer = NULL
  • var \PartStreamContainer holds 'stream' and 'content stream'.
© 2023 Bruce Wells
Search Namespaces \ Classes