Fully Qualified Name: | Zend\Mail\AddressList |
Implements: | Countable, Iterator |
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" |
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 |
Add an address to the list
Parameter Name | Type | Description |
---|---|---|
$emailOrAddress | string|\Address\AddressInterface | |
$name | null|string |
Returns: \AddressList
Add an address to the list from any valid string format, such as
- "ZF Dev"
Parameter Name | Type | Description |
---|---|---|
$address | string | |
$comment | null|string | Comment |
Returns: \AddressList
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
Return count of addresses
Returns: int
Return current item in iteration
Returns: \Address
Delete an address from the list
Parameter Name | Type | Description |
---|---|---|
string |
Returns: bool
Get an address by email
Parameter Name | Type | Description |
---|---|---|
string |
Returns: bool|\Address\AddressInterface
Does the email exist in this list?
Parameter Name | Type | Description |
---|---|---|
string |
Returns: bool
Return key of current item of iteration
Returns: string
Merge another address list into this one
Parameter Name | Type | Description |
---|---|---|
$addressList | \AddressList |
Returns: \AddressList
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 iterator
Returns: mixed the value of the first addresses element, or false if the addresses is empty.
Is the current item of iteration valid?
Returns: bool