XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_Mime_SimpleHeaderSet Class Reference
Inheritance diagram for Swift_Mime_SimpleHeaderSet:
Inheritance graph

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 22 of file SimpleHeaderSet.php.

Constructor & Destructor Documentation

Swift_Mime_SimpleHeaderSet::__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 46 of file SimpleHeaderSet.php.

References setCharset().

Here is the call graph for this function:

Member Function Documentation

Swift_Mime_SimpleHeaderSet::__toString ( )

Returns a string representation of this object.

Returns
string
See Also
toString()

Definition at line 324 of file SimpleHeaderSet.php.

References toString().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::_canSort ( )
private

Test if the headers can be sorted

Definition at line 349 of file SimpleHeaderSet.php.

Referenced by toString().

Here is the caller graph for this function:

Swift_Mime_SimpleHeaderSet::_isDisplayed ( Swift_Mime_Header  $header)
private

Test if the given Header is always displayed

Definition at line 379 of file SimpleHeaderSet.php.

References Swift_Mime_Header\getFieldName().

Referenced by toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleHeaderSet::_notifyHeadersOfCharset (   $charset)
private

Notify all Headers of the new charset

Definition at line 385 of file SimpleHeaderSet.php.

Referenced by setCharset().

Here is the caller graph for this function:

Swift_Mime_SimpleHeaderSet::_sortHeaders (   $a,
  $b 
)
private

uksort() algorithm for Header ordering

Definition at line 355 of file SimpleHeaderSet.php.

References elseif().

Here is the call graph for this function:

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

Save a Header to the internal collection

Definition at line 332 of file SimpleHeaderSet.php.

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

Here is the caller graph for this function:

Swift_Mime_SimpleHeaderSet::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 86 of file SimpleHeaderSet.php.

References _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 125 of file SimpleHeaderSet.php.

References _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 74 of file SimpleHeaderSet.php.

References _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 111 of file SimpleHeaderSet.php.

References _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 136 of file SimpleHeaderSet.php.

References $path, and _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 98 of file SimpleHeaderSet.php.

References _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::charsetChanged (   $charset)

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

Parameters
string$charset

Implements Swift_Mime_CharsetObserver.

Definition at line 286 of file SimpleHeaderSet.php.

References setCharset().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 264 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::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 186 of file SimpleHeaderSet.php.

References has().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::getAll (   $name = null)

Get all headers with the given $name.

Parameters
string$name
Returns
array

Implements Swift_Mime_HeaderSet.

Definition at line 202 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::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
boolean

Implements Swift_Mime_HeaderSet.

Definition at line 151 of file SimpleHeaderSet.php.

Referenced by get().

Here is the caller graph for this function:

Swift_Mime_SimpleHeaderSet::newInstance ( )

Create a new instance of this HeaderSet.

Returns
Swift_Mime_HeaderSet

Implements Swift_Mime_HeaderSet.

Definition at line 252 of file SimpleHeaderSet.php.

References $_factory.

Swift_Mime_SimpleHeaderSet::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 230 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::removeAll (   $name)

Remove all headers with the given $name.

Parameters
string$name

Implements Swift_Mime_HeaderSet.

Definition at line 241 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::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 170 of file SimpleHeaderSet.php.

References _storeHeader().

Here is the call graph for this function:

Swift_Mime_SimpleHeaderSet::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 276 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::setCharset (   $charset)

Set the charset used by these headers.

Parameters
string$charset

Definition at line 61 of file SimpleHeaderSet.php.

References _notifyHeadersOfCharset().

Referenced by __construct(), and charsetChanged().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_SimpleHeaderSet::toString ( )

Returns a string with a representation of all headers.

Returns
string

Implements Swift_Mime_HeaderSet.

Definition at line 296 of file SimpleHeaderSet.php.

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

Referenced by __toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Swift_Mime_SimpleHeaderSet::$_charset
private

The charset used by Headers

Definition at line 38 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::$_factory
private

HeaderFactory

Definition at line 26 of file SimpleHeaderSet.php.

Referenced by newInstance().

Swift_Mime_SimpleHeaderSet::$_headers = array()
private

Collection of set Headers

Definition at line 29 of file SimpleHeaderSet.php.

Referenced by toString().

Swift_Mime_SimpleHeaderSet::$_order = array()
private

Field ordering details

Definition at line 32 of file SimpleHeaderSet.php.

Swift_Mime_SimpleHeaderSet::$_required = array()
private

List of fields which are required to be displayed

Definition at line 35 of file SimpleHeaderSet.php.


The documentation for this class was generated from the following file: