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

updatePhone() protected méthode

Updates the given phone.
protected updatePhone ( Phone $phone, $entry ) : boolean
$phone Sulu\Bundle\ContactBundle\Entity\Phone The phone object to update
$entry The entry with the new data
Résultat boolean True if successful, otherwise false
    protected function updatePhone(Phone $phone, $entry)
    {
        $success = true;
        $phoneType = $this->em->getRepository(self::$phoneTypeEntityName)->find($entry['phoneType']['id']);
        if (!$phoneType) {
            throw new EntityNotFoundException(self::$phoneTypeEntityName, $entry['phoneType']['id']);
        } else {
            $phone->setPhone($entry['phone']);
            $phone->setPhoneType($phoneType);
        }
        return $success;
    }