PHP Класс Swift_Mime_Headers_MailboxHeader

Автор: Chris Corbyn
Наследование: extends Swift_Mime_Headers_AbstractHeader
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $name, Swift_Mime_HeaderEncoder $encoder, Egulias\EmailValidator\EmailValidator $emailValidator ) Creates a new MailboxHeader with $name.
getAddresses ( ) : string[] Get all email addresses in this Header.
getFieldBody ( ) : string Get the string value of the body in this Header.
getFieldBodyModel ( ) : array Get the model for the field body.
getFieldType ( ) : integer Get the type of Header that this instance represents.
getNameAddressStrings ( ) : string[] Get the full mailbox list of this Header as an array of valid RFC 2822 strings.
getNameAddresses ( ) : string[] Get all mailboxes in this Header as key=>value pairs.
removeAddresses ( string | string[] $addresses ) Remove one or more addresses from this Header.
setAddresses ( string[] $addresses ) Makes this Header represent a list of plain email addresses with no names.
setFieldBodyModel ( mixed $model ) Set the model for the field body.
setNameAddresses ( string | string[] $mailboxes ) Set a list of mailboxes to be shown in this Header.

Защищенные методы

Метод Описание
createDisplayNameString ( string $displayName, boolean $shorten = false ) : string Produces a compliant, formatted display-name based on the string given.
createMailboxListString ( array $mailboxes ) : string Creates a string form of all the mailboxes in the passed array.
normalizeMailboxes ( array $mailboxes ) : string[] Normalizes a user-input list of mailboxes into consistent key=>value pairs.
tokenNeedsEncoding ( string $token ) : boolean Redefine the encoding requirements for mailboxes.

Приватные методы

Метод Описание
assertValidAddress ( string $address ) Throws an Exception if the address passed does not comply with RFC 2822.
createNameAddressStrings ( array $mailboxes ) : string[] Return an array of strings conforming the the name-addr spec of RFC 2822.

Описание методов

__construct() публичный Метод

Creates a new MailboxHeader with $name.
public __construct ( string $name, Swift_Mime_HeaderEncoder $encoder, Egulias\EmailValidator\EmailValidator $emailValidator )
$name string of Header
$encoder Swift_Mime_HeaderEncoder
$emailValidator Egulias\EmailValidator\EmailValidator

createDisplayNameString() защищенный Метод

Produces a compliant, formatted display-name based on the string given.
protected createDisplayNameString ( string $displayName, boolean $shorten = false ) : string
$displayName string as displayed
$shorten boolean the first line to make remove for header name
Результат string

createMailboxListString() защищенный Метод

Creates a string form of all the mailboxes in the passed array.
protected createMailboxListString ( array $mailboxes ) : string
$mailboxes array
Результат string

getAddresses() публичный Метод

Get all email addresses in this Header.
См. также: getNameAddresses()
public getAddresses ( ) : string[]
Результат string[]

getFieldBody() публичный Метод

This is not necessarily RFC 2822 compliant since folding white space will not be added at this stage (see {@link toString()} for that).
См. также: toString()
public getFieldBody ( ) : string
Результат string

getFieldBodyModel() публичный Метод

This method returns an associative array like {@link getNameAddresses()}
public getFieldBodyModel ( ) : array
Результат array

getFieldType() публичный Метод

Get the type of Header that this instance represents.
public getFieldType ( ) : integer
Результат integer

getNameAddressStrings() публичный Метод

Example: 'Chris Corbyn', '[email protected]' => 'Mark Corbyn') ); print_r($header->getNameAddressStrings()); array ( 0 => Chris Corbyn , 1 => Mark Corbyn ) ?>
См. также: getNameAddresses()
См. также: toString()
public getNameAddressStrings ( ) : string[]
Результат string[]

getNameAddresses() публичный Метод

The key is the address and the value is the name (or null if none set). Example: 'Chris Corbyn', '[email protected]' => 'Mark Corbyn') ); print_r($header->getNameAddresses()); array ( [email protected] => Chris Corbyn, [email protected] => Mark Corbyn ) ?>
См. также: getAddresses()
См. также: getNameAddressStrings()
public getNameAddresses ( ) : string[]
Результат string[]

normalizeMailboxes() защищенный Метод

Normalizes a user-input list of mailboxes into consistent key=>value pairs.
protected normalizeMailboxes ( array $mailboxes ) : string[]
$mailboxes array
Результат string[]

removeAddresses() публичный Метод

Remove one or more addresses from this Header.
public removeAddresses ( string | string[] $addresses )
$addresses string | string[]

setAddresses() публичный Метод

Example: setAddresses( array('[email protected]', '[email protected]', '[email protected]') ); ?>
См. также: setNameAddresses()
См. также: setValue()
public setAddresses ( string[] $addresses )
$addresses string[]

setFieldBodyModel() публичный Метод

This method takes a string, or an array of addresses.
public setFieldBodyModel ( mixed $model )
$model mixed

setNameAddresses() публичный Метод

The mailboxes can be a simple array of addresses, or an array of key=>value pairs where (email => personalName). Example: setNameAddresses(array( '[email protected]' => 'Chris Corbyn', '[email protected]' //No associated personal name )); ?>
См. также: __construct()
См. также: setAddresses()
См. также: setValue()
public setNameAddresses ( string | string[] $mailboxes )
$mailboxes string | string[]

tokenNeedsEncoding() защищенный Метод

All "specials" must be encoded as the full header value will not be quoted
См. также: RFC 2822 3.2.1
protected tokenNeedsEncoding ( string $token ) : boolean
$token string
Результат boolean