/** * Merges the information from another phone number into this phone number. * * @param PhoneNumber $other The phone number to copy. * * @return PhoneNumber This PhoneNumber instance, for chaining method calls. */ public function mergeFrom(PhoneNumber $other) { if ($other->hasCountryCode()) { $this->setCountryCode($other->getCountryCode()); } if ($other->hasNationalNumber()) { $this->setNationalNumber($other->getNationalNumber()); } if ($other->hasExtension()) { $this->setExtension($other->getExtension()); } if ($other->hasItalianLeadingZero()) { $this->setItalianLeadingZero($other->isItalianLeadingZero()); } if ($other->hasNumberOfLeadingZeros()) { $this->setNumberOfLeadingZeros($other->getNumberOfLeadingZeros()); } if ($other->hasRawInput()) { $this->setRawInput($other->getRawInput()); } if ($other->hasCountryCodeSource()) { $this->setCountryCodeSource($other->getCountryCodeSource()); } if ($other->hasPreferredDomesticCarrierCode()) { $this->setPreferredDomesticCarrierCode($other->getPreferredDomesticCarrierCode()); } return $this; }