getCurrentRequest()->getSession()->get(MondialRelay::SESSION_SELECTED_PICKUP_RELAY_ID)) { return MondialRelayPickupAddressQuery::create()->filterById($relayId); } elseif (null !== $orderAddressId = $this->getOrderAddressId()) { return MondialRelayPickupAddressQuery::create()->filterByOrderAddressId($orderAddressId); } elseif (null !== $orderId = $this->getOrderId()) { if (null !== $order = OrderQuery::create()->findPk($orderId)) { return MondialRelayPickupAddressQuery::create() ->filterByOrderAddressId($order->getDeliveryOrderAddressId()); } } return null; } public function parseResults(LoopResult $loopResult) { /** @var MondialRelayPickupAddress $item */ foreach ($loopResult->getResultDataCollection() as $item) { $loopResultRow = new LoopResultRow($item); $relayData = json_decode($item->getJsonRelayData(), true); $loopResultRow ->set("ID", $relayData['id']) ->set("LATITUDE", $relayData['latitude']) ->set("LONGITUDE", $relayData['longitude']) ->set("ZIPCODE", $relayData['zipcode']) ->set("CITY", $relayData['city']) ->set("COUNTRY", $relayData['country']) ->set("NAME", $relayData['name']) ->set("ADDRESS", $relayData['address']) ->set("DISTANCE", $relayData['distance']) ->set("OPENINGS", $relayData['openings']) ; $loopResult->addRow($loopResultRow); } return $loopResult; } }