public function updateDeliveryAddress(OrderEvent $event) { if ($this->check_module($event->getOrder()->getDeliveryModuleId())) { $request = $this->getRequest(); $tmp_address = AddressIcirelaisQuery::create()->findPk($request->getSession()->get('DpdPickupDeliveryId')); if ($tmp_address === null) { throw new \ErrorException("Got an error with DpdPickup module. Please try again to checkout."); } $savecode = new OrderAddressIcirelais(); $savecode->setId($event->getOrder()->getDeliveryOrderAddressId())->setCode($tmp_address->getCode())->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(); $tmp_address->delete(); } }
/** * Exclude object from result * * @param ChildOrderAddressIcirelais $orderAddressIcirelais Object to remove from the list of results * * @return ChildOrderAddressIcirelaisQuery The current query, for fluid interface */ public function prune($orderAddressIcirelais = null) { if ($orderAddressIcirelais) { $this->addUsingAlias(OrderAddressIcirelaisTableMap::ID, $orderAddressIcirelais->getId(), Criteria::NOT_EQUAL); } return $this; }