libphonenumber\ShortNumberInfo::getNationalSignificantNumber PHP Method

getNationalSignificantNumber() protected method

This is a temporary duplicate of the {@code getNationalSignificantNumber} method from {@code PhoneNumberUtil}. Ultimately a canonical static version should exist in a separate utility class (to prevent {@code ShortNumberInfo} needing to depend on PhoneNumberUtil).

protected getNationalSignificantNumber ( PhoneNumber $number ) : string
$number PhoneNumber the phone number for which the national significant number is needed
return string the national significant number of the PhoneNumber object passed in
    protected function getNationalSignificantNumber(PhoneNumber $number)
    {
        // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix.
        $nationalNumber = '';
        if ($number->isItalianLeadingZero()) {
            $zeros = str_repeat('0', $number->getNumberOfLeadingZeros());
            $nationalNumber .= $zeros;
        }
        $nationalNumber .= $number->getNationalNumber();
        return $nationalNumber;
    }