Ejemplo n.º 1
0
 /**
  * Get Postalcode
  *
  * @return string Postalcode
  */
 public function getPostalcode()
 {
     return $this->address->getPostalcode();
 }
Ejemplo n.º 2
0
 /**
  * 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());
 }
Ejemplo n.º 3
0
 /**
  * @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());
 }
Ejemplo n.º 4
0
 /**
  * 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);
 }