TYPO3  7.6
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Swift_Mime_SimpleHeaderSet Class Reference
Inheritance diagram for Swift_Mime_SimpleHeaderSet:
Swift_Mime_HeaderSet Swift_Mime_CharsetObserver

Public Member Functions

 __construct (Swift_Mime_HeaderFactory $factory, $charset=null)
 
 setCharset ($charset)
 
 addMailboxHeader ($name, $addresses=null)
 
 addDateHeader ($name, $timestamp=null)
 
 addTextHeader ($name, $value=null)
 
 addParameterizedHeader ($name, $value=null, $params=array())
 
 addIdHeader ($name, $ids=null)
 
 addPathHeader ($name, $path=null)
 
 has ($name, $index=0)
 
 set (Swift_Mime_Header $header, $index=0)
 
 get ($name, $index=0)
 
 getAll ($name=null)
 
 listAll ()
 
 remove ($name, $index=0)
 
 removeAll ($name)
 
 newInstance ()
 
 defineOrdering (array $sequence)
 
 setAlwaysDisplayed (array $names)
 
 charsetChanged ($charset)
 
 toString ()
 
 __toString ()
 
 __clone ()
 

Private Member Functions

 _storeHeader ($name, Swift_Mime_Header $header, $offset=null)
 
 _canSort ()
 
 _sortHeaders ($a, $b)
 
 _isDisplayed (Swift_Mime_Header $header)
 
 _notifyHeadersOfCharset ($charset)
 

Private Attributes

 $_factory
 
 $_headers = array()
 
 $_order = array()
 
 $_required = array()
 
 $_charset
 

Detailed Description

A collection of MIME headers.

Author
Chris Corbyn

Definition at line 16 of file SimpleHeaderSet.php.

Constructor & Destructor Documentation

__construct ( Swift_Mime_HeaderFactory  $factory,
  $charset = null 
)

Create a new SimpleHeaderSet with the given $factory.

Parameters
Swift_Mime_HeaderFactory$factory
string$charset

Definition at line 39 of file SimpleHeaderSet.php.

References setCharset().

Member Function Documentation

__clone ( )

Make a deep copy of object.

Definition at line 387 of file SimpleHeaderSet.php.

References $_factory.

__toString ( )

Returns a string representation of this object.

Returns
string
See Also
toString()

Definition at line 323 of file SimpleHeaderSet.php.

References toString().

_canSort ( )
private

Test if the headers can be sorted

Definition at line 342 of file SimpleHeaderSet.php.

Referenced by listAll(), and toString().

_isDisplayed ( Swift_Mime_Header  $header)
private

Test if the given Header is always displayed

Definition at line 369 of file SimpleHeaderSet.php.

References Swift_Mime_Header\getFieldName().

Referenced by toString().

_notifyHeadersOfCharset (   $charset)
private

Notify all Headers of the new charset

Definition at line 375 of file SimpleHeaderSet.php.

Referenced by setCharset().

_sortHeaders (   $a,
  $b 
)
private

uksort() algorithm for Header ordering

Definition at line 348 of file SimpleHeaderSet.php.

References elseif.

_storeHeader (   $name,
Swift_Mime_Header  $header,
  $offset = null 
)
private

Save a Header to the internal collection

Definition at line 329 of file SimpleHeaderSet.php.

Referenced by addDateHeader(), addIdHeader(), addMailboxHeader(), addParameterizedHeader(), addPathHeader(), addTextHeader(), and set().

addDateHeader (   $name,
  $timestamp = null 
)

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

Parameters
string$name
int$timestamp

Implements Swift_Mime_HeaderSet.

Definition at line 77 of file SimpleHeaderSet.php.

References _storeHeader().

addIdHeader (   $name,
  $ids = null 
)

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

Parameters
string$name
string | array$ids

Implements Swift_Mime_HeaderSet.

Definition at line 113 of file SimpleHeaderSet.php.

References _storeHeader().

addMailboxHeader (   $name,
  $addresses = null 
)

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

Parameters
string$name
array | string$addresses

Implements Swift_Mime_HeaderSet.

Definition at line 65 of file SimpleHeaderSet.php.

References _storeHeader().

addParameterizedHeader (   $name,
  $value = null,
  $params = array() 
)

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

Parameters
string$name
string$value
array$params

Implements Swift_Mime_HeaderSet.

Definition at line 102 of file SimpleHeaderSet.php.

References _storeHeader().

addPathHeader (   $name,
  $path = null 
)

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

Parameters
string$name
string$path

Implements Swift_Mime_HeaderSet.

Definition at line 124 of file SimpleHeaderSet.php.

References _storeHeader().

addTextHeader (   $name,
  $value = null 
)

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

Parameters
string$name
string$value

Implements Swift_Mime_HeaderSet.

Definition at line 89 of file SimpleHeaderSet.php.

References _storeHeader().

charsetChanged (   $charset)

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

Parameters
string$charset

Implements Swift_Mime_CharsetObserver.

Definition at line 288 of file SimpleHeaderSet.php.

References setCharset().

defineOrdering ( array  $sequence)

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

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

Parameters
array$sequence

Implements Swift_Mime_HeaderSet.

Definition at line 266 of file SimpleHeaderSet.php.

get (   $name,
  $index = 0 
)

Get the header with the given $name.

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

Parameters
string$name
int$index
Returns
Swift_Mime_Header

Implements Swift_Mime_HeaderSet.

Definition at line 174 of file SimpleHeaderSet.php.

References has().

getAll (   $name = null)

Get all headers with the given $name.

Parameters
string$name
Returns
array

Implements Swift_Mime_HeaderSet.

Definition at line 190 of file SimpleHeaderSet.php.

has (   $name,
  $index = 0 
)

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

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

Parameters
string$name
int$index
Returns
bool

Implements Swift_Mime_HeaderSet.

Definition at line 139 of file SimpleHeaderSet.php.

Referenced by get().

listAll ( )

Return the name of all Headers.

Returns
array

Implements Swift_Mime_HeaderSet.

Definition at line 214 of file SimpleHeaderSet.php.

References $_headers, and _canSort().

newInstance ( )

Create a new instance of this HeaderSet.

Returns
Swift_Mime_HeaderSet

Implements Swift_Mime_HeaderSet.

Definition at line 254 of file SimpleHeaderSet.php.

References $_factory.

remove (   $name,
  $index = 0 
)

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

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

Parameters
string$name
int$index

Implements Swift_Mime_HeaderSet.

Definition at line 232 of file SimpleHeaderSet.php.

removeAll (   $name)

Remove all headers with the given $name.

Parameters
string$name

Implements Swift_Mime_HeaderSet.

Definition at line 243 of file SimpleHeaderSet.php.

set ( Swift_Mime_Header  $header,
  $index = 0 
)

Set a header in the HeaderSet.

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
Swift_Mime_Header$header
int$index

Implements Swift_Mime_HeaderSet.

Definition at line 158 of file SimpleHeaderSet.php.

References _storeHeader().

setAlwaysDisplayed ( array  $names)

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

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

Parameters
array$names

Implements Swift_Mime_HeaderSet.

Definition at line 278 of file SimpleHeaderSet.php.

setCharset (   $charset)

Set the charset used by these headers.

Parameters
string$charset

Definition at line 52 of file SimpleHeaderSet.php.

References _notifyHeadersOfCharset().

Referenced by __construct(), and charsetChanged().

toString ( )

Returns a string with a representation of all headers.

Returns
string

Implements Swift_Mime_HeaderSet.

Definition at line 298 of file SimpleHeaderSet.php.

References $_headers, _canSort(), and _isDisplayed().

Referenced by __toString().

Member Data Documentation

$_charset
private

The charset used by Headers

Definition at line 31 of file SimpleHeaderSet.php.

$_factory
private

HeaderFactory

Definition at line 19 of file SimpleHeaderSet.php.

Referenced by __clone(), and newInstance().

$_headers = array()
private

Collection of set Headers

Definition at line 22 of file SimpleHeaderSet.php.

Referenced by listAll(), and toString().

$_order = array()
private

Field ordering details

Definition at line 25 of file SimpleHeaderSet.php.

$_required = array()
private

List of fields which are required to be displayed

Definition at line 28 of file SimpleHeaderSet.php.