Beispiel #1
0
 private function populateGeneral(AbstractContact $contact)
 {
     $contact->setNotes('This is a note for this contact.');
     if (Rand::getFloat(true) < 0.8) {
         $contact->setDisplayName(Rand::getString(32));
     }
 }
Beispiel #2
0
 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();
 }
Beispiel #3
0
 public function getUrl(AbstractContact $contact)
 {
     if ($contact->getAvatar()) {
         $src = 'img/avatars/' . $contact->getAvatar() . '.png';
     } else {
         $src = 'img/avatars/' . $contact->getId()->toString() . '.png';
     }
     if (!is_file('public/' . $src)) {
         $src = 'img/avatars/default.png';
     }
     return $this->getView()->basePath($src);
 }
Beispiel #4
0
 public function getDisplayName()
 {
     $displayName = parent::getDisplayName();
     if (!$displayName) {
         $displayName = $this->getName();
     }
     return $displayName;
 }