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

Public Member Functions

 __construct ($name, Swift_Mime_HeaderEncoder $encoder)
 
 getAddresses ()
 
 getFieldBody ()
 
 getFieldBodyModel ()
 
 getFieldType ()
 
 getNameAddresses ()
 
 getNameAddressStrings ()
 
 removeAddresses ($addresses)
 
 setAddresses ($addresses)
 
 setFieldBodyModel ($model)
 
 setNameAddresses ($mailboxes)
 
- Public Member Functions inherited from Swift_Mime_Headers_AbstractHeader
 __toString ()
 
 getCharset ()
 
 getEncoder ()
 
 getFieldName ()
 
 getLanguage ()
 
 getMaxLineLength ()
 
 setCharset ($charset)
 
 setEncoder (Swift_Mime_HeaderEncoder $encoder)
 
 setLanguage ($lang)
 
 setMaxLineLength ($lineLength)
 
 toString ()
 

Protected Member Functions

 createDisplayNameString ($displayName, $shorten=false)
 
 createMailboxListString (array $mailboxes)
 
 normalizeMailboxes (array $mailboxes)
 
- Protected Member Functions inherited from Swift_Mime_Headers_AbstractHeader
 clearCachedValueIf ($condition)
 
 createPhrase (Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder=null, $shorten=false)
 
 encodeWords (Swift_Mime_Header $header, $input, $usedLength=-1)
 
 escapeSpecials ($token, $include=array(), $exclude=array())
 
 generateTokenLines ($token)
 
 getCachedValue ()
 
 getEncodableWordTokens ($string)
 
 getGrammar ($name)
 
 getTokenAsEncodedWord ($token, $firstLineOffset=0)
 
 initializeGrammar ()
 
 setCachedValue ($value)
 
 setFieldName ($name)
 
 tokenNeedsEncoding ($token)
 
 toTokens ($string=null)
 

Private Member Functions

 _assertValidAddress ($address)
 
 _createNameAddressStrings (array $mailboxes)
 

Private Attributes

 $_mailboxes = array()
 

Additional Inherited Members

- Public Attributes inherited from Swift_Mime_Header
const TYPE_DATE = 16
 
const TYPE_ID = 32
 
const TYPE_MAILBOX = 8
 
const TYPE_PARAMETERIZED = 6
 
const TYPE_PATH = 64
 
const TYPE_TEXT = 2
 

Detailed Description

Definition at line 20 of file MailboxHeader.php.

Constructor & Destructor Documentation

Swift_Mime_Headers_MailboxHeader::__construct (   $name,
Swift_Mime_HeaderEncoder  $encoder 
)

Creates a new MailboxHeader with $name.

Parameters
string$nameof Header
Swift_Mime_HeaderEncoder$encoder

Definition at line 35 of file MailboxHeader.php.

References Swift_Mime_Headers_AbstractHeader\initializeGrammar(), Swift_Mime_Headers_AbstractHeader\setEncoder(), and Swift_Mime_Headers_AbstractHeader\setFieldName().

Here is the call graph for this function:

Member Function Documentation

Swift_Mime_Headers_MailboxHeader::_assertValidAddress (   $address)
private

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

Parameters
string$address
Exceptions
ExceptionIf invalid. protected

Definition at line 304 of file MailboxHeader.php.

References Swift_Mime_Headers_AbstractHeader\getGrammar().

Referenced by normalizeMailboxes().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_MailboxHeader::_createNameAddressStrings ( array  $mailboxes)
private

Return an array of strings conforming the the name-addr spec of RFC 2822.

Parameters
string[]$mailboxes
Returns
string[] private

Definition at line 280 of file MailboxHeader.php.

References createDisplayNameString().

Referenced by createMailboxListString(), and getNameAddressStrings().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_MailboxHeader::createDisplayNameString (   $displayName,
  $shorten = false 
)
protected

Produces a compliant, formatted display-name based on the string given.

Parameters
string$displayNameas displayed
boolean$shortenthe first line to make remove for header name
Returns
string protected

Definition at line 253 of file MailboxHeader.php.

References Swift_Mime_Headers_AbstractHeader\createPhrase(), Swift_Mime_Headers_AbstractHeader\getCharset(), and Swift_Mime_Headers_AbstractHeader\getEncoder().

Referenced by _createNameAddressStrings().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_MailboxHeader::createMailboxListString ( array  $mailboxes)
protected

Creates a string form of all the mailboxes in the passed array.

Parameters
string[]$mailboxes
Returns
string
Exceptions
Swift_RfcComplianceExceptionprotected

Definition at line 267 of file MailboxHeader.php.

References _createNameAddressStrings().

Referenced by getFieldBody().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_MailboxHeader::getAddresses ( )

Get all email addresses in this Header.

Returns
string[]
See Also
getNameAddresses()

Definition at line 179 of file MailboxHeader.php.

Swift_Mime_Headers_MailboxHeader::getFieldBody ( )

Get the string value of the body in this Header. This is not necessarily RFC 2822 compliant since folding white space will not be added at this stage (see toString() for that).

Returns
string
Exceptions
Swift_RfcComplianceException
See Also
toString()

Implements Swift_Mime_Header.

Definition at line 205 of file MailboxHeader.php.

References createMailboxListString(), Swift_Mime_Headers_AbstractHeader\getCachedValue(), and Swift_Mime_Headers_AbstractHeader\setCachedValue().

Here is the call graph for this function:

Swift_Mime_Headers_MailboxHeader::getFieldBodyModel ( )

Get the model for the field body. This method returns an associative array like getNameAddresses()

Returns
array
Exceptions
Swift_RfcComplianceException

Implements Swift_Mime_Header.

Definition at line 70 of file MailboxHeader.php.

References getNameAddresses().

Here is the call graph for this function:

Swift_Mime_Headers_MailboxHeader::getFieldType ( )

Get the type of Header that this instance represents.

Returns
int
See Also
TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX
TYPE_DATE, TYPE_ID, TYPE_PATH

Implements Swift_Mime_Header.

Definition at line 48 of file MailboxHeader.php.

Swift_Mime_Headers_MailboxHeader::getNameAddresses ( )

Get all mailboxes in this Header as key=>value pairs. The key is the address and the value is the name (or null if none set). Example: <?php $header = new Swift_Mime_Headers_MailboxHeader('From', array('chris.nosp@m.@swi.nosp@m.ftmai.nosp@m.ler..nosp@m.org' => 'Chris Corbyn', 'mark@.nosp@m.swif.nosp@m.tmail.nosp@m.er.o.nosp@m.rg' => 'Mark Corbyn') ); print_r($header->getNameAddresses()); // array ( // chris.nosp@m.@swi.nosp@m.ftmai.nosp@m.ler..nosp@m.org => Chris Corbyn, // mark@.nosp@m.swif.nosp@m.tmail.nosp@m.er.o.nosp@m.rg => Mark Corbyn // ) ?>

Returns
string[]
See Also
getAddresses()
getNameAddressStrings()

Definition at line 148 of file MailboxHeader.php.

References $_mailboxes.

Referenced by getFieldBodyModel(), and getNameAddressStrings().

Here is the caller graph for this function:

Swift_Mime_Headers_MailboxHeader::getNameAddressStrings ( )

Get the full mailbox list of this Header as an array of valid RFC 2822 strings. Example: <?php $header = new Swift_Mime_Headers_MailboxHeader('From', array('chris.nosp@m.@swi.nosp@m.ftmai.nosp@m.ler..nosp@m.org' => 'Chris Corbyn', 'mark@.nosp@m.swif.nosp@m.tmail.nosp@m.er.o.nosp@m.rg' => 'Mark Corbyn') ); print_r($header->getNameAddressStrings()); // array ( // 0 => Chris Corbyn chris.nosp@m.@swi.nosp@m.ftmai.nosp@m.ler..nosp@m.org, // 1 => Mark Corbyn mark@.nosp@m.swif.nosp@m.tmail.nosp@m.er.o.nosp@m.rg // ) ?>

Returns
string[]
Exceptions
Swift_RfcComplianceException
See Also
getNameAddresses()
toString()

Definition at line 122 of file MailboxHeader.php.

References _createNameAddressStrings(), and getNameAddresses().

Here is the call graph for this function:

Swift_Mime_Headers_MailboxHeader::normalizeMailboxes ( array  $mailboxes)
protected

Normalizes a user-input list of mailboxes into consistent key=>value pairs.

Parameters
string[]$mailboxes
Returns
string[] protected

Definition at line 223 of file MailboxHeader.php.

References _assertValidAddress().

Referenced by setNameAddresses().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_MailboxHeader::removeAddresses (   $addresses)

Remove one or more addresses from this Header.

Parameters
string|string[]$addresses

Definition at line 188 of file MailboxHeader.php.

References Swift_Mime_Headers_AbstractHeader\setCachedValue().

Here is the call graph for this function:

Swift_Mime_Headers_MailboxHeader::setAddresses (   $addresses)

Makes this Header represent a list of plain email addresses with no names. Example: <?php //Sets three email addresses as the Header data $header->setAddresses( array('one@d.nosp@m.omai.nosp@m.n.tld', 'two@d.nosp@m.omai.nosp@m.n.tld', 'three.nosp@m.@dom.nosp@m.ain.t.nosp@m.ld') ); ?>

Parameters
string[]$addresses
Exceptions
Swift_RfcComplianceException
See Also
setNameAddresses()
setValue()

Definition at line 169 of file MailboxHeader.php.

References setNameAddresses().

Here is the call graph for this function:

Swift_Mime_Headers_MailboxHeader::setFieldBodyModel (   $model)

Set the model for the field body. This method takes a string, or an array of addresses.

Parameters
mixed$model
Exceptions
Swift_RfcComplianceException

Implements Swift_Mime_Header.

Definition at line 59 of file MailboxHeader.php.

References setNameAddresses().

Here is the call graph for this function:

Swift_Mime_Headers_MailboxHeader::setNameAddresses (   $mailboxes)

Set a list of mailboxes to be shown in this Header. The mailboxes can be a simple array of addresses, or an array of key=>value pairs where (email => personalName). Example: <?php //Sets two mailboxes in the Header, one with a personal name $header->setNameAddresses(array( 'chris.nosp@m.@swi.nosp@m.ftmai.nosp@m.ler..nosp@m.org' => 'Chris Corbyn', 'mark@.nosp@m.swif.nosp@m.tmail.nosp@m.er.o.nosp@m.rg' //No associated personal name )); ?>

Parameters
string|string[]$mailboxes
Exceptions
Swift_RfcComplianceException
See Also
__construct()
setAddresses()
setValue()

Definition at line 95 of file MailboxHeader.php.

References normalizeMailboxes(), and Swift_Mime_Headers_AbstractHeader\setCachedValue().

Referenced by setAddresses(), and setFieldBodyModel().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Swift_Mime_Headers_MailboxHeader::$_mailboxes = array()
private

Definition at line 28 of file MailboxHeader.php.

Referenced by getNameAddresses().


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