Class AddressList

Summary

Fully Qualified Name: Zend\Mail\AddressList
Implements: Countable, Iterator

Description

Methods

Name Description Defined By
add() Add an address to the list AddressList
addFromString() Add an address to the list from any valid string format, such as - "ZF Dev" - dev@zf.com AddressList
addMany() Add many addresses at once AddressList
count() Return count of addresses AddressList
current() Return current item in iteration AddressList
delete() Delete an address from the list AddressList
get() Get an address by email AddressList
has() Does the email exist in this list? AddressList
key() Return key of current item of iteration AddressList
merge() Merge another address list into this one AddressList
next() Move to next item AddressList
rewind() Rewind iterator AddressList
valid() Is the current item of iteration valid? AddressList

Method Details

add()

Add an address to the list

Parameter Name Type Description
$emailOrAddress string|\Address\AddressInterface
$name null|string

Returns: \AddressList

addFromString()

Add an address to the list from any valid string format, such as - "ZF Dev" - dev@zf.com

Parameter Name Type Description
$address string
$comment null|string Comment

Returns: \AddressList

addMany()

Add many addresses at once

If an email key is provided, it will be used as the email, and the value as the name. Otherwise, the value is passed as the sole argument to add(), and, as such, can be either email strings or Address\AddressInterface objects.

Parameter Name Type Description
$addresses array

Returns: \AddressList

count()

Return count of addresses

Returns: int

current()

Return current item in iteration

Returns: \Address

delete()

Delete an address from the list

Parameter Name Type Description
$email string

Returns: bool

get()

Get an address by email

Parameter Name Type Description
$email string

Returns: bool|\Address\AddressInterface

has()

Does the email exist in this list?

Parameter Name Type Description
$email string

Returns: bool

key()

Return key of current item of iteration

Returns: string

merge()

Merge another address list into this one

Parameter Name Type Description
$addressList \AddressList

Returns: \AddressList

next()

Move to next item

Returns: mixed the addresses value in the next place that's pointed to by the internal array pointer, or false if there are no more elements.

rewind()

Rewind iterator

Returns: mixed the value of the first addresses element, or false if the addresses is empty.

valid()

Is the current item of iteration valid?

Returns: bool

Top