PHP 클래스 Swift_Mime_Headers_MailboxHeader

저자: Chris Corbyn
상속: extends Swift_Mime_Headers_AbstractHeader
파일 보기 프로젝트 열기: swiftmailer/swiftmailer 1 사용 예제들

공개 메소드들

메소드 설명
__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