public function __get($what)
{
switch ($what) {
case 'addressObject':
$address = new Horde_Mail_Rfc822_Address($this->email);
if (!empty($this->name)) {
$address->personal = $this->name;
}
return $address;
case 'displayName':
if (strlen($this->name)) {
return $this->name;
}
if (strlen($this->user)) {
return $this->user;
}
return $this->email;
case 'id':
if (strlen($this->user)) {
return 'user:' . $this->user;
}
if (strlen($this->email)) {
return 'email:' . $this->email;
}
return 'name:' . $this->name;
}
}