An ID MIME Header for something like Message-ID or Content-ID.

package Swift
subpackage Mime
author Chris Corbyn

 Methods

Creates a new IdentificationHeader with the given $name and $id.

__construct(string $name, \Swift_Mime_Grammar $grammar) 

Parameters

$name

string

Returns a string representation of this object.

__toString() : string
Inherited
see \toString()
inherited_from \Swift_Mime_Headers_AbstractHeader::__toString()

Returns

string

Get the character set used in this Header.

getCharset() : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getCharset()

Returns

string

Get the encoder used for encoding this Header.

getEncoder() : \Swift_Mime_HeaderEncoder
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getEncoder()

Returns

Get the string value of the body in this Header.

getFieldBody() : string

This is not necessarily RFC 2822 compliant since folding white space will not be added at this stage (see toString() for that).

see \toString()

Exceptions

\Swift_RfcComplianceException

Returns

string

Get the model for the field body.

getFieldBodyModel() : array

This method returns an array of IDs

Returns

array

Get the name of this header (e.g.

getFieldName() : string
Inherited

charset).

inherited_from \Swift_Mime_Headers_AbstractHeader::getFieldName()

Returns

string

Get the type of Header that this instance represents.

getFieldType() : int

Get the grammar used for this Header.

getGrammar() : \Swift_Mime_Grammar
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getGrammar()

Returns

Get the ID used in the value of this Header.

getId() : string

If multiple IDs are set only the first is returned.

Returns

string

Get the list of IDs used in this Header.

getIds() : string[]

Returns

string[]

Get the language used in this Header.

getLanguage() : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getLanguage()

Returns

string

Get the maximum permitted length of lines in this Header.

getMaxLineLength() : int
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getMaxLineLength()

Returns

int

Set the character set used in this Header.

setCharset(string $charset) 
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::setCharset()

Parameters

$charset

string

Set the encoder used for encoding the header.

setEncoder(\Swift_Mime_HeaderEncoder $encoder) 
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::setEncoder()

Parameters

Set the model for the field body.

setFieldBodyModel(mixed $model) 

This method takes a string ID, or an array of IDs

Parameters

$model

mixed

Exceptions

\Swift_RfcComplianceException

Set the grammar used for the header.

setGrammar(\Swift_Mime_Grammar $grammar) 
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::setGrammar()

Parameters

Set the ID used in the value of this header.

setId(string | array $id) 

Parameters

$id

stringarray

Exceptions

\Swift_RfcComplianceException

Set a collection of IDs to use in the value of this Header.

setIds(array $ids) 

Parameters

$ids

string[]

Exceptions

\Swift_RfcComplianceException

Set the language used in this Header.

setLanguage(string $lang) 
Inherited

For example, for US English, 'en-us'. This can be unspecified.

inherited_from \Swift_Mime_Headers_AbstractHeader::setLanguage()

Parameters

$lang

string

Set the maximum length of lines in the header (excluding EOL).

setMaxLineLength(int $lineLength) 
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::setMaxLineLength()

Parameters

$lineLength

int

Get this Header rendered as a RFC 2822 compliant string.

toString() : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::toString()

Exceptions

\Swift_RfcComplianceException

Returns

string

Clear the cached value if $condition is met.

clearCachedValueIf(boolean $condition) 
Inherited
access protected
inherited_from \Swift_Mime_Headers_AbstractHeader::clearCachedValueIf()

Parameters

$condition

boolean

Produces a compliant, formatted RFC 2822 'phrase' based on the string given.

createPhrase(\Swift_Mime_Header $header, string $string, string $charset, \Swift_Mime_HeaderEncoder $encoder, boolean $shorten) : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::createPhrase()

Parameters

$string

string

as displayed

$charset

string

of the text

$shorten

boolean

the first line to make remove for header name

Returns

string

Encode needed word tokens within a string of input.

encodeWords(\Swift_Mime_Header $header, string $input, $usedLength) : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::encodeWords()

Parameters

$header

$input

string

$usedLength

Returns

string

Generates tokens from the given string which include CRLF as individual tokens.

generateTokenLines(string $token) : string[]
Inherited
access protected
inherited_from \Swift_Mime_Headers_AbstractHeader::generateTokenLines()

Parameters

$token

string

Returns

string[]

Get the value in the cache.

getCachedValue() : string
Inherited
access protected
inherited_from \Swift_Mime_Headers_AbstractHeader::getCachedValue()

Returns

string

Splits a string into tokens in blocks of words which can be encoded quickly.

getEncodableWordTokens(string $string) : string[]
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getEncodableWordTokens()

Parameters

$string

string

Returns

string[]

Get a token as an encoded word for safe insertion into headers.

getTokenAsEncodedWord(string $token, $firstLineOffset) : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::getTokenAsEncodedWord()

Parameters

$token

string

to encode

$firstLineOffset

Returns

string

Set a value into the cache.

setCachedValue(string $value) 
Inherited
access protected
inherited_from \Swift_Mime_Headers_AbstractHeader::setCachedValue()

Parameters

$value

string

Set the name of this Header field.

setFieldName(string $name) 
Inherited
access protected
inherited_from \Swift_Mime_Headers_AbstractHeader::setFieldName()

Parameters

$name

string

Generate a list of all tokens in the final header.

toTokens(string $string) : array
Inherited
access protected
inherited_from \Swift_Mime_Headers_AbstractHeader::toTokens()

Parameters

$string

string

The string to tokenize

Returns

arrayAn array of tokens as strings

Test if a token needs to be encoded or not.

tokenNeedsEncoding(string $token) : boolean
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::tokenNeedsEncoding()

Parameters

$token

string

Returns

boolean

Throws an Exception if the id passed does not comply with RFC 2822.

_assertValidId(string $id) 

Parameters

$id

string

Exceptions

\Swift_RfcComplianceException

Takes an array of tokens which appear in the header and turns them into an RFC 2822 compliant string, adding FWSP where needed.

_tokensToString(array $tokens) : string
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::_tokensToString()

Parameters

$tokens

string[]

Returns

string

 Properties

 

$_cachedValue : string
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_cachedValue
 

$_charset : string
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_charset
 

$_encoder : \Swift_Encoder
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_encoder
 

$_grammar : \Swift_Mime_Grammar
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_grammar
 

$_ids : string[]

This may hold multiple IDs or just a single ID.

access private
 

$_lang : string
Inherited
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_lang
 

$_lineLength : int
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_lineLength
 

$_name : string
Inherited
access private
inherited_from \Swift_Mime_Headers_AbstractHeader::$$_name

 Constants

 

Date and time headers

TYPE_DATE 
Inherited
inherited_from \Swift_Mime_Header::TYPE_DATE
inherited_from \Swift_Mime_Headers_AbstractHeader::TYPE_DATE
 

Identification headers

TYPE_ID 
Inherited
inherited_from \Swift_Mime_Header::TYPE_ID
inherited_from \Swift_Mime_Headers_AbstractHeader::TYPE_ID
 

Mailbox and address headers

TYPE_MAILBOX 
Inherited
inherited_from \Swift_Mime_Header::TYPE_MAILBOX
inherited_from \Swift_Mime_Headers_AbstractHeader::TYPE_MAILBOX
 

Parameterized headers (text + params)

TYPE_PARAMETERIZED 
Inherited
inherited_from \Swift_Mime_Header::TYPE_PARAMETERIZED
inherited_from \Swift_Mime_Headers_AbstractHeader::TYPE_PARAMETERIZED
 

Address path headers

TYPE_PATH 
Inherited
inherited_from \Swift_Mime_Header::TYPE_PATH
inherited_from \Swift_Mime_Headers_AbstractHeader::TYPE_PATH
 

Text headers

TYPE_TEXT 
Inherited
inherited_from \Swift_Mime_Header::TYPE_TEXT
inherited_from \Swift_Mime_Headers_AbstractHeader::TYPE_TEXT