Elgg  Version master
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Elgg\Email\Address Class Reference

Email address. More...

Inheritance diagram for Elgg\Email\Address:

Public Member Functions

 __construct ($email, $name=null, $comment=null)
 {} More...
 
 setEmail ($email)
 Set the email address. More...
 
 setName ($name)
 Set the name. More...
 
 unsetName ()
 Clear the name from the email address. More...
 
 setEntity (\ElggEntity $entity)
 Store the Entity related to this Address. More...
 
 getEntity ()
 Returns the saved entity. More...
 

Static Public Member Functions

static fromString ($contact, $ignored=null)
 Parses strings like "Evan <evan@elgg.org>" into name/email objects. More...
 
static fromEntity (\ElggEntity $entity)
 Create an Address based on a Entity. More...
 
static getFormattedEmailAddress ($email, $name=null)
 Format an email address and name into a formatted email address. More...
 

Protected Attributes

 $entity = null
 

Detailed Description

Email address.

Since
3.0

Definition at line 15 of file Address.php.

Constructor & Destructor Documentation

Elgg\Email\Address::__construct (   $email,
  $name = null,
  $comment = null 
)

{}

Definition at line 25 of file Address.php.

Member Function Documentation

static Elgg\Email\Address::fromEntity ( \ElggEntity  $entity)
static

Create an Address based on a Entity.

Parameters
\ElggEntity$entitythe entity to create the address for
Returns
Exceptions

Definition at line 152 of file Address.php.

static Elgg\Email\Address::fromString (   $contact,
  $ignored = null 
)
static

Parses strings like "Evan <evan@elgg.org>" into name/email objects.

This is not very sophisticated and only used to provide a light BC effort.

Parameters
string$contacte.g. "Evan <evan@elgg.org>"
string$ignoredIgnored (required for Laminas)
Returns
Exceptions

Definition at line 133 of file Address.php.

Elgg\Email\Address::getEntity ( )

Returns the saved entity.

Returns
|null
Since
4.0

Definition at line 117 of file Address.php.

static Elgg\Email\Address::getFormattedEmailAddress (   $email,
  $name = null 
)
static

Format an email address and name into a formatted email address.

eg "Some name <someone@example.com>"

Parameters
string$emailthe email address
string$namethe name
Returns
string
Exceptions

Definition at line 170 of file Address.php.

Elgg\Email\Address::setEmail (   $email)

Set the email address.

Parameters
string$emailthe new email address
Returns
void
Exceptions

Definition at line 46 of file Address.php.

Elgg\Email\Address::setEntity ( \ElggEntity  $entity)

Store the Entity related to this Address.

Parameters
\ElggEntity$entity
Returns
void
Since
4.0

Definition at line 106 of file Address.php.

Elgg\Email\Address::setName (   $name)

Set the name.

Parameters
string$namethe new name
Returns
void
Exceptions

Definition at line 74 of file Address.php.

Elgg\Email\Address::unsetName ( )

Clear the name from the email address.

Returns
void
Since
3.0

Definition at line 93 of file Address.php.

Member Data Documentation

Elgg\Email\Address::$entity = null
protected

Definition at line 20 of file Address.php.


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