public function getDisplayName() { $displayName = parent::getDisplayName(); if (!$displayName) { $displayName = $this->getName(); } return $displayName; }
public function __construct(AbstractContact $contact) { $this->id = $contact->getId(); $this->type = $contact instanceof Person ? 'person' : 'company'; $this->creationDate = $contact->getCreationDate(); $this->lastUpdated = $contact->getLastUpdated(); $this->displayName = $contact->getDisplayName(); }