Get postal code

If no "postal code" value has been set, this method will
set and return a default "postal code" value,
if any such value is available

@see getDefaultPostalCode()

@return string|null postal code or null if no postal code has been set
199871
public function getPostalCode() : ?string 
    {
        if ( ! $this->hasPostalCode()) {
            $this->setPostalCode($this->getDefaultPostalCode());
        }
        return $this->postalCode;
    }
309522
public function getDefaultValues()
    {
        preg_match('/([0-9.]+)([A-Z]{3})/', $this->config['price'], $matches);

        $this->defaults['price'] = array(
            'currency' => (!empty($this->defaults['price']['currency']) ? $this->defaults['price']['currency'] : $matches[2]),
            'amount' => (!empty($this->defaults['price']['amount']) ? $this->defaults['price']['amount'] : $matches[1]),
            'vat' => (!empty($this->defaults['price']['vat']) ? $this->defaults['price']['vat'] : null),
        );

        return $this->defaults;
    }
1146347
public function getPostalAddress()
    {
        $postalAddress = $this->getProfileAttribute(self::ATTR_POSTAL_ADDRESS);
        if (null === $postalAddress) {
            // Get it from structured_postal_address.formatted_address
            $postalAddress = $this->getFormattedAddress();
        }
        return $postalAddress;
    }
208335
protected function getDefaultFormValues()
    {
        $defaultValues = $this->acumulusConfig->getCredentials()
             + $this->acumulusConfig->getShopSettings()
             + $this->acumulusConfig->getShopEventSettings()
             + $this->acumulusConfig->getCustomerSettings()
             + $this->acumulusConfig->getInvoiceSettings()
             + $this->acumulusConfig->getEmailAsPdfSettings()
             + $this->acumulusConfig->getPluginSettings();
        return $defaultValues;
    }
226449
protected function initDefault()
    {
        if ($this->isCli()) {
            return null;
        }

        $uri = (empty($_SERVER['HTTPS']) ? 'http' : 'https')
            . '://'
            . $_SERVER['HTTP_HOST']
            . $_SERVER['REQUEST_URI'];
        return  rtrim(preg_replace('/\?.*/', '', $uri), '/');
    }
318038
public function getDefault()
    {
        if ($this->default) {
            return $this->default;
        }
        if (!empty($this->values)) {
            return reset($this->values);
        }
        return null;
    }
301642
public function geocode( $postal_code ) {
    // Setup local variable for holding results from geocoder.
    $addressCollection = null;

    // Try to call the geocoder.
    try {
      // Set it call to geocoder...
      $curl     = new \Ivory\HttpAdapter\CurlHttpAdapter();
      $geocoder = new \Geocoder\Provider\GoogleMaps( $curl, null, null, true );

      // Geocode the zipcode...
      $addressCollection = $geocoder->geocode( $postal_code );
    } catch ( \Exception $exception ) {
      // Recover from exception by rethrowing wrapped in GeocodingException.
      throw new GeocodingException( 'An exception occurred during geocoding.', 0, $exception );
    }

    // Make sure geocode found at least one result.
    if ( ! $addressCollection->has( 0 ) ) {
      throw new GeocodingException( 'ZIP code geocode did not return any results: ' . $postal_code );
    }

    // Store first result in local variable.
    $address = $addressCollection->get( 0 );

    // Return result.
    return new LatLon( $address->getLatitude(), $address->getLongitude() );
  }
923757
public static function getCurrencyCode()
	{
		if (!isset(self::$_currencyCode)) {
			$localeconv = localeconv();
			self::$_currencyCode = ($localeconv['currency_symbol'] != '')
				? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol'];

			if (self::$_currencyCode == '') {
				// Default to $
				self::$_currencyCode = '$';
			}
		}
		return self::$_currencyCode;
	}
303822
public function generate()
    {
        $code = '';

        if ($this->type !== null) {
            $code .= $this->type . ' ';
        }

        if ($this->passByReference === true) {
            $code .= '&';
        }

        $code .= '$' . $this->name;

        if ($this->defaultValue !== null) {
            if ($this->isDefaultValueConstant() === true) {
                $code .= ' = ' . $this->getDefaultValueConstantName();
            } else {
                $this->defaultValue->setOutputMode(ValueGenerator::OUTPUT_SINGLE_LINE);
                $code .= ' = ' . $this->defaultValue;
            }
        }

        return $code;
    }
656992
protected function getAuthorizationCode()
    {
        $code = null;
        if ($this->responseMode === 'query' && isset($_GET['code'])) {
            $code = $_GET['code'];
        } else if ($this->responseMode === 'form_post' && isset($_POST['code'])) {
            $code = $_POST['code'];
        }

        return $code;
    }
101095
public function getDefaultValue()
    {
        if ($this->isArray() || $this->isList()) {
            return [];
        }
        return Utils::getValueWithinItsType($this->getMetaValueFirstSet([
            'default',
            'Default',
            'DefaultValue',
            'defaultValue',
            'defaultvalue',
        ]), $this->getType(true));
    }
1231303
public function getReasonCode()
    {
        $code = null;

        if (isset($this->data->transactionResponse->messages)) {
            // In case of a successful transaction, a "messages" element is present
            $code = intval((string)$this->data->transactionResponse->messages->message->code);
        } elseif (isset($this->data->transactionResponse->errors)) {
            // In case of an unsuccessful transaction, an "errors" element is present
            $code = intval((string)$this->data->transactionResponse->errors->error->errorCode);
        } elseif (isset($this->data->messages->message)) {
            // In case of invalid request, the top-level message provides details.
            $code = (string)$this->data->messages->message->code;
        }

        return $code;
    }
695589
public function getDefault() {
    	if ($this->isPublic() && !$this->isStatic() && $this->refClass->isAbstract() == false) {	    		 
	  		$className = $this->refClass->getName();
	  		// TODO: find a way to get default value for abstract properties.
	  		// TODO: optimize this: we should not have to create one new instance for every property....
	  		/*$instance = new $className();
			$property = $this->getName();
	    	return $instance->$property;*/
	  		
	  		// In some cases, the call to getDefaultProperties can log NOTICES
	  		// in particular if an undefined constant is used as default value.
	  		ob_start();
	  		$defaultProperties = $this->refClass->getDefaultProperties();
	  		$possibleError = ob_get_clean();
			if ($possibleError) {
				throw new \Exception($possibleError);	
			}
	  		return $defaultProperties[$this->getName()];
    	} else {
    		return null;
    	}
    }
946314
public function getResponseReasonCode()
    {
        $responseCode = null;
        if (isset($this->data['directResponse'])) {
            $directResponse = explode(',', (string)$this->data['directResponse']);
            $responseCode = $directResponse[2];
        }

        return $responseCode;
    }
981884
protected function getElementData()
    {
        $obDefaultCurrency = CurrencyHelper::instance()->getDefault();
        $sCurrencyCode = !empty($obDefaultCurrency) ? $obDefaultCurrency->code : null;

        $arResult = [
            'price_value'     => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePriceType(null)->price_value,
            'old_price_value' => $this->obElement->setActiveCurrency($sCurrencyCode)->setActivePriceType(null)->old_price_value,
            'trashed'         => $this->obElement->trashed(),
        ];

        return $arResult;
    }
36368
public function getEmail()
    {
        $primaryAddress = $this->getPrimaryAddress();
        if ($primaryAddress === null) {
            return null;
        }

        $emails = $primaryAddress->getEmails();
        if (empty($emails)) {
            return null;
        }

        foreach ($emails as $email) {
            if (is_array($email) && $email['primary'] === true) {
                return $email['value'];
            }

            return $email->getValue();
        }

        return $emails[0]->getValue();
    }
877864
public static function getDefault()
    {
        if ((self::$compatibilityMode === true) or (func_num_args() > 0)) {
            if (!self::$_breakChain) {
                self::$_breakChain = true;
                trigger_error('You are running Zend_Locale in compatibility mode... please migrate your scripts', E_USER_NOTICE);
                $params = func_get_args();
                $param = null;
                if (isset($params[0])) {
                    $param = $params[0];
                }
                return self::getOrder($param);
            }

            self::$_breakChain = false;
        }

        return self::$_default;
    }