Changeset View
Changeset View
Standalone View
Standalone View
src/parser/PhutilEmailAddress.php
Show All 36 Lines | public function __construct($email_address = null) { | ||||
$this->displayName = $display_name; | $this->displayName = $display_name; | ||||
$this->localPart = $local_part; | $this->localPart = $local_part; | ||||
$this->domainName = $domain_name; | $this->domainName = $domain_name; | ||||
} | } | ||||
public function __toString() { | public function __toString() { | ||||
$address = $this->getAddress(); | $address = $this->getAddress(); | ||||
if (strlen($this->displayName)) { | |||||
if (phutil_nonempty_string($this->displayName)) { | |||||
$display_name = $this->encodeDisplayName($this->displayName); | $display_name = $this->encodeDisplayName($this->displayName); | ||||
return $display_name.' <'.$address.'>'; | return $display_name.' <'.$address.'>'; | ||||
} else { | |||||
return $address; | |||||
} | } | ||||
return $address; | |||||
} | } | ||||
public function setDisplayName($display_name) { | public function setDisplayName($display_name) { | ||||
$this->displayName = $display_name; | $this->displayName = $display_name; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getDisplayName() { | public function getDisplayName() { | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |