protected function removeOrderAddressIfContactAddressIdIsEqualTo($item, $contactAddressId)
    {
        $deliveryAddress = $item->getDeliveryAddress();
        if ($deliveryAddress
            && $deliveryAddress->getContactAddress()
            && $deliveryAddress->getContactAddress()->getID() === $contactAddressId
        ) {
            $item->setDeliveryAddress(null);
            $this->em->remove($deliveryAddress);
        }
    }
protected function removeOrderAddressIfContactAddressIdIsEqualTo($item, $contactAddressId)
    {
        $deliveryAddress = $item->getDeliveryAddress();
        if ($deliveryAddress
            && $deliveryAddress->getContactAddress()
            && $deliveryAddress->getContactAddress()->getID() === $contactAddressId
        ) {
            $item->setDeliveryAddress(null);
            $this->em->remove($deliveryAddress);
        }
    }
protected function removeOrderAddressIfContactAddressIdIsEqualTo ( $ item , $ contactAddressId ) { $ deliveryAddress = $ item -> getDeliveryAddress ( ) ; if ( $ deliveryAddress && $ deliveryAddress -> getContactAddress ( ) && $ deliveryAddress -> getContactAddress ( ) -> getID ( ) === $ contactAddressId ) { $ item -> setDeliveryAddress ( null ) ; $ this -> em -> remove ( $ deliveryAddress ) ; } }
Remove deliveryAddress if it has a relation to a certain contact-address-id

@param Item $item
@param int $contactAddressId
Remove deliveryAddress if it has a relation to a certain contact - address - id