getEmails() public method

Get emails.
public getEmails ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection
Ejemplo n.º 1
0
 /**
  * sets Entity's Main-Email.
  *
  * @param Contact|AccountInterface $entity
  */
 public function setMainEmail($entity)
 {
     // set main to first entry or to null
     if ($entity->getEmails()->isEmpty()) {
         $entity->setMainEmail(null);
     } else {
         $entity->setMainEmail($entity->getEmails()->first()->getEmail());
     }
 }