MailMimeParser 2.3

PartFilter
in package

Collection of static methods that return callables for common IMultiPart child filters.

Tags
author

Zaahid Bateson

Table of Contents

fromAttachmentFilter()  : callable
Provides an 'attachment' filter used by Message::getAttachmentPart.
fromContentType()  : callable
Includes only parts that match the passed $mimeType in the return value of a call to 'getContentType()'.
fromDisposition()  : callable
Finds parts with the passed disposition (matching against IMessagePart::getContentDisposition()), optionally including multipart parts and signed parts.
fromHeaderValue()  : callable
Provides a filter that keeps parts that contain a header of $name with a value that matches $value (case insensitive).
fromInlineContentType()  : callable
Returns parts matching $mimeType that do not have a Content-Disposition set to 'attachment'.

Methods

fromAttachmentFilter()

Provides an 'attachment' filter used by Message::getAttachmentPart.

public static fromAttachmentFilter() : callable

The method filters out the following types of parts:

  • text/plain and text/html parts that do not have an 'attachment' disposition
  • any part that returns true for isMultiPart()
  • any part that returns true for isSignaturePart()
Return values
callable

fromContentType()

Includes only parts that match the passed $mimeType in the return value of a call to 'getContentType()'.

public static fromContentType(string $mimeType) : callable
Parameters
$mimeType : string

Mime type of parts to find.

Return values
callable

fromDisposition()

Finds parts with the passed disposition (matching against IMessagePart::getContentDisposition()), optionally including multipart parts and signed parts.

public static fromDisposition(string $disposition[, bool $includeMultipart = false ][, bool $includeSignedParts = false ]) : callable
Parameters
$disposition : string

The disposition to find.

$includeMultipart : bool = false

Optionally include multipart parts by passing true (defaults to false).

$includeSignedParts : bool = false

Optionally include signed parts (defaults to false).

Return values
callable

fromHeaderValue()

Provides a filter that keeps parts that contain a header of $name with a value that matches $value (case insensitive).

public static fromHeaderValue(string $name, string $value[, bool $excludeSignedParts = true ]) : callable

By default signed parts are excluded. Pass FALSE to the third parameter to include them.

Parameters
$name : string

The header name to look up

$value : string

The value to match

$excludeSignedParts : bool = true

Optional signed parts exclusion (defaults to true).

Return values
callable

fromInlineContentType()

Returns parts matching $mimeType that do not have a Content-Disposition set to 'attachment'.

public static fromInlineContentType(string $mimeType) : callable
Parameters
$mimeType : string

Mime type of parts to find.

Return values
callable

Search results