countryCode = $definition['country_code']; $this->administrativeArea = !empty($definition['administrative_area']) ? $definition['administrative_area'] : null; $this->locality = !empty($definition['locality']) ? $definition['locality'] : null; $this->dependentLocality = !empty($definition['dependent_locality']) ? $definition['dependent_locality'] : null; $this->includedPostalCodes = !empty($definition['included_postal_codes']) ? $definition['included_postal_codes'] : null; $this->excludedPostalCodes = !empty($definition['excluded_postal_codes']) ? $definition['excluded_postal_codes'] : null; } /** * Gets the country code. * * @return string The country code. */ public function getCountryCode(): string { return $this->countryCode; } /** * Gets the administrative area. * * @return string|null The administrative area, or null if all should match. */ public function getAdministrativeArea(): ?string { return $this->administrativeArea; } /** * Gets the locality. * * @return string|null The locality, or null if all should match. */ public function getLocality(): ?string { return $this->locality; } /** * Gets the dependent locality. * * @return string|null The dependent locality, or null if all should match. */ public function getDependentLocality(): ?string { return $this->dependentLocality; } /** * Gets the included postal codes. * * @return string|null The included postal codes, or null if all should match. */ public function getIncludedPostalCodes(): ?string { return $this->includedPostalCodes; } /** * Gets the excluded postal codes. * * @return string|null The excluded postal codes, or null if all should match. */ public function getExcludedPostalCodes(): ?string { return $this->excludedPostalCodes; } /** * Checks whether the provided address belongs to the territory. * * @return bool True if the address belongs to the territory, false otherwise. */ public function match(AddressInterface $address): bool { if ($address->getCountryCode() != $this->countryCode) { return false; } if ($this->administrativeArea && $this->administrativeArea != $address->getAdministrativeArea()) { return false; } if ($this->locality && $this->locality != $address->getLocality()) { return false; } if ($this->dependentLocality && $this->dependentLocality != $address->getDependentLocality()) { return false; } if (!PostalCodeHelper::match($address->getPostalCode(), $this->includedPostalCodes, $this->excludedPostalCodes)) { return false; } return true; } } __halt_compiler();----SIGNATURE:----R0qufMgOXOuFP2DUKy/E6KqxP1cTJEjtBcvJlnv1dHsJ9hIg8xyrPdtKSxzTIpiyFkhY0RN8G8ol7Whi4WFx35rm0AyNwglKwU14tNR0CPaD3gh3S2dBNdtQCCrqYB7z24vyZ84VufMIbfyKwEZ0my+IioEXfxiSo1jg6Zwl6G1P36i1V6hHlGflD7egiGPo01yrphx1v6bhukb6NMVCHQ7U1sgFikbsJbhplMhPhu7WimDmBdvtkRSIMcRjQM6/wjQyqGggXUM79aVqbnaU0S7PdPRQJ32viyYMMhhdvhLUEivVfSI6zq/wTb03WnU3bVf8zVobwd5ZH8kuAYLEHRFZuGpkxt8ajyTi99XDpKRAFwbLu8i1i3mA9bYFmxmoVtgdARmVhSYO2Vsvis2AEshjwbhoVx3G4lA/k8mU5oGMegEtKEa7HuSXTPFkq/ohJ7ft5XIz2dRUHNMPHn0xtvc9K25YJhINfZ8Ay+lkanKg6sGqSXjDXyZKNhYjYhMk96yaaASV3cR8kFuDjH9Uq+5InS9N90TPoRPosmDXm9CbnYDrQXbW+zMju7kNM/1bKSpeLm0/kbs57mW459ZN2g/qzTjsTBnKalrqk30B7y4rrM+FBPTnNv3IpUJWwcFn/5xjXZV7j3OCfb0G3Eo8d1tmtnRPcLJYTt9D8nw8QUA=----ATTACHMENT:----NTkwMTc5Nzc5MzUzODYzNSA3NzU4MjU1NTkxMjU5MDggNDI1OTc3MzUwNjcwMzUwMw==