/**
  * Exclude object from result
  *
  * @param   ChildOrderAddressSocolissimo $orderAddressSocolissimo Object to remove from the list of results
  *
  * @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
  */
 public function prune($orderAddressSocolissimo = null)
 {
     if ($orderAddressSocolissimo) {
         $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddressSocolissimo->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 public function updateDeliveryAddress(OrderEvent $event)
 {
     if ($this->check_module($event->getOrder()->getDeliveryModuleId())) {
         $request = $this->getRequest();
         if ($request->getSession()->get('SoColissimoDomicile') == 1) {
             $tmp_address = AddressSoColissimoQuery::create()->findPk($request->getSession()->get('SoColissimoDeliveryId'));
             if ($tmp_address === null) {
                 throw new \ErrorException("Got an error with So Colissimo module. Please try again to checkout.");
             }
             $savecode = new OrderAddressSocolissimo();
             $savecode->setId($event->getOrder()->getDeliveryOrderAddressId())->setCode(0)->setType($tmp_address->getType())->save();
             $update = OrderAddressQuery::create()->findPK($event->getOrder()->getDeliveryOrderAddressId())->setCompany($tmp_address->getCompany())->setAddress1($tmp_address->getAddress1())->setAddress2($tmp_address->getAddress2())->setAddress3($tmp_address->getAddress3())->setZipcode($tmp_address->getZipcode())->setCity($tmp_address->getCity())->save();
         } elseif ($request->getSession()->get('SoColissimoRdv') == 1) {
             $tmp_address = AddressSoColissimoQuery::create()->findPk($request->getSession()->get('SoColissimoDeliveryId'));
             if ($tmp_address === null) {
                 throw new \ErrorException("Got an error with So Colissimo module. Please try again to checkout.");
             }
             $savecode = new OrderAddressSocolissimo();
             $savecode->setId($event->getOrder()->getDeliveryOrderAddressId())->setCode(0)->setType($tmp_address->getType())->save();
             $update = OrderAddressQuery::create()->findPK($event->getOrder()->getDeliveryOrderAddressId())->setCompany($tmp_address->getCompany())->setAddress1($tmp_address->getAddress1())->setAddress2($tmp_address->getAddress2())->setAddress3($tmp_address->getAddress3())->setZipcode($tmp_address->getZipcode())->setCity($tmp_address->getCity())->setPhone($tmp_address->getCellphone())->save();
         } else {
             $tmp_address = AddressSoColissimoQuery::create()->findPk($request->getSession()->get('SoColissimoDeliveryId'));
             if ($tmp_address === null) {
                 throw new \ErrorException("Got an error with So Colissimo module. Please try again to checkout.");
             }
             $savecode = new OrderAddressSocolissimo();
             $savecode->setId($event->getOrder()->getDeliveryOrderAddressId())->setCode($tmp_address->getCode())->setType($tmp_address->getType())->save();
             $update = OrderAddressQuery::create()->findPK($event->getOrder()->getDeliveryOrderAddressId())->setCompany($tmp_address->getCompany())->setAddress1($tmp_address->getAddress1())->setAddress2($tmp_address->getAddress2())->setAddress3($tmp_address->getAddress3())->setZipcode($tmp_address->getZipcode())->setCity($tmp_address->getCity())->save();
         }
     }
 }