Sulu\Bundle\ContactBundle\Contact\AbstractContactManager::updateEmail PHP Méthode

updateEmail() protected méthode

Updates the given email address.
protected updateEmail ( Email $email, array $entry ) : boolean
$email Sulu\Bundle\ContactBundle\Entity\Email The email object to update
$entry array The entry with the new data
Résultat boolean True if successful, otherwise false
    protected function updateEmail(Email $email, $entry)
    {
        $success = true;
        $emailType = $this->em->getRepository(self::$emailTypeEntityName)->find($entry['emailType']['id']);
        if (!$emailType) {
            throw new EntityNotFoundException(self::$emailTypeEntityName, $entry['emailType']['id']);
        } else {
            $email->setEmail($entry['email']);
            $email->setEmailType($emailType);
        }
        return $success;
    }