src/Sulu/Bundle/ContactBundle/Contact/AbstractContactManager.php
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());
        }
    }
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());
        }
    }
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 ( ) ) ; } }
sets Entity's Main-Email.

@param Contact|AccountInterface $entity
sets Entity s Main - Email .