/** * Get Postalcode * * @return string Postalcode */ public function getPostalcode() { return $this->address->getPostalcode(); }
/** * Builds a full address string. * * @param AddressInterface $address The address * @param array $cityHierarchy The full city hierarchy * * @return string */ private function buildFullAddressString(AddressInterface $address, array $cityHierarchy) { $cityString = implode(', ', $cityHierarchy); return sprintf('%s %s, %s %s', $address->getAddress(), $address->getAddressMore(), $cityString, $address->getPostalcode()); }
/** * @param ZoneInterface $zone * @param AddressInterface $address * * @return boolean Address is contained in zone */ public function isAddressContainedInZone(ZoneInterface $zone, AddressInterface $address) { $city = $address->getCity(); return $this->isCountryContainedInZone($zone, $city->getCountry()) || $this->isStateContainedInZone($zone, $city->getState()) || $this->isProvinceContainedInZone($zone, $city->getProvince()) || $this->isCityContainedInZone($zone, $address->getCity()) || $this->isPostalCodeContainedInZone($zone, $address->getPostalcode()); }
/** * Get all zones where the address is included in * * @param ZoneInterface $zone Zone * @param AddressInterface $address Address * * @return boolean Address is contained in zone */ public function getZonesFromAddress(ZoneInterface $zone, AddressInterface $address) { $city = $address->getCity(); $zones = array_merge([], $this->getZonesFromCountry($zone, $city->getCountry())->toArray(), $this->getZonesFromState($zone, $city->getState())->toArray(), $this->getZonesFromProvince($zone, $city->getProvince())->toArray(), $this->getZonesFromCity($zone, $city)->toArray(), $this->getZonesFromPostalCode($zone, $address->getPostalcode())->toArray()); return new ArrayCollection($zones); }