A collection of MIME headers.

package Swift
subpackage Mime
author Chris Corbyn

 Methods

Create a new SimpleHeaderSet with the given $factory.

__construct(\Swift_Mime_HeaderFactory $factory, string $charset) 

Parameters

$charset

string

Returns a string representation of this object.

__toString() : string
see \toString()

Returns

string

Add a new Date header using $timestamp (UNIX time).

addDateHeader(string $name, int $timestamp) 

Parameters

$name

string

$timestamp

int

Add a new ID header for Message-ID or Content-ID.

addIdHeader(string $name, string | array $ids) 

Parameters

$name

string

$ids

stringarray

Add a new Mailbox Header with a list of $addresses.

addMailboxHeader(string $name, array | string $addresses) 

Parameters

$name

string

$addresses

arraystring

Add a new ParameterizedHeader with $name, $value and $params.

addParameterizedHeader(string $name, string $value, array $params) 

Parameters

$name

string

$value

string

$params

array

Add a new Path header with an address (path) in it.

addPathHeader(string $name, string $path) 

Parameters

$name

string

$path

string

Add a new basic text header with $name and $value.

addTextHeader(string $name, string $value) 

Parameters

$name

string

$value

string

Notify this observer that the entity's charset has changed.

charsetChanged(string $charset) 

Parameters

$charset

string

Define a list of Header names as an array in the correct order.

defineOrdering(array $sequence) 

These Headers will be output in the given order where present.

Parameters

$sequence

array

Get the header with the given $name.

get(string $name, int $index) : \Swift_Mime_Header

If multiple headers match, the actual one may be specified by $index. Returns NULL if none present.

Parameters

$name

string

$index

int

Returns

Get all headers with the given $name.

getAll(string $name) : array

Parameters

$name

string

Returns

array

Returns true if at least one header with the given $name exists.

has(string $name, int $index) : boolean

If multiple headers match, the actual one may be specified by $index.

Parameters

$name

string

$index

int

Returns

boolean

Create a new instance of this HeaderSet.

newInstance() : \Swift_Mime_HeaderSet

Remove the header with the given $name if it's set.

remove(string $name, int $index) 

If multiple headers match, the actual one may be specified by $index.

Parameters

$name

string

$index

int

Remove all headers with the given $name.

removeAll(string $name) 

Parameters

$name

string

Set a header in the HeaderSet.

set(\Swift_Mime_Header $header, int $index) 

The header may be a previously fetched header via get() or it may be one that has been created separately.

If $index is specified, the header will be inserted into the set at this offset.

Parameters

$index

int

Set a list of header names which must always be displayed when set.

setAlwaysDisplayed(array $names) 

Usually headers without a field value won't be output unless set here.

Parameters

$names

array

Set the charset used by these headers.

setCharset(string $charset) 

Parameters

$charset

string

Returns a string with a representation of all headers.

toString() : string

Returns

string

Test if the headers can be sorted

_canSort() 

Test if the given Header is always displayed

_isDisplayed(\Swift_Mime_Header $header) 

Parameters

$header

Notify all Headers of the new charset

_notifyHeadersOfCharset($charset) 

Parameters

$charset

uksort() algorithm for Header ordering

_sortHeaders($a, $b) 

Parameters

$a

$b

Save a Header to the internal collection

_storeHeader($name, \Swift_Mime_Header $header, $offset) 

Parameters

$name

$header

$offset

 Properties

 

$_charset 
 

$_factory 
 

$_headers 
 

$_order 
 

$_required