Elcodi\Plugin\CustomShippingBundle\Entity\Interfaces\ShippingRangeInterface::getToZone PHP Method

getToZone() public method

Get ToZone
public getToZone ( ) : Elcodi\Component\Zone\Entity\Interfaces\ZoneInterface
return Elcodi\Component\Zone\Entity\Interfaces\ZoneInterface ToZone
    public function getToZone();

Usage Example

 /**
  * Given ShippingRange zones are satisfied by a cart,
  *
  * @param CartInterface          $cart          Cart
  * @param ShippingRangeInterface $shippingRange Carrier Range
  *
  * @return boolean ShippingRange is satisfied by cart
  */
 private function isShippingRangeZonesSatisfiedByCart(CartInterface $cart, ShippingRangeInterface $shippingRange)
 {
     $deliveryAddress = $cart->getDeliveryAddress();
     $shippingRange->getToZone()->getName();
     return $deliveryAddress === null || $this->zoneMatcher->isAddressContainedInZone($deliveryAddress, $shippingRange->getToZone());
 }