/** * @param DrivingOrder $drivingOrder * @return DrivingOrderEditDTO */ public function drivingOrderToEditDto(DrivingOrder $drivingOrder) { $dto = new DrivingOrderEditDTO(); $dto->id = $drivingOrder->getId(); $dto->pickupDate = $this->dateTimeService->convertToLocalDateTime($drivingOrder->getPickUpDate())->format('d.m.Y'); $dto->pickupTime = $this->dateTimeService->convertToLocalDateTime($drivingOrder->getPickUpTime())->format('H:i'); $dto->lookaheadaddressFrom = $drivingOrder->getRoute()->getStartAddress()->toString(); $dto->lookaheadaddressTo = $drivingOrder->getRoute()->getTargetAddress()->toString(); $dto->zoneName = $drivingOrder->getZone()->getName(); $dto->compagnion = $drivingOrder->getCompanion(); $dto->memo = $drivingOrder->getMemo(); $dto->additionalTime = $drivingOrder->getAdditionalTime(); $dto->orderStatus = $drivingOrder->getStatus(); /** @var RepeatedDrivingOrderPlan $repeatedDrivingOrderPlan */ $repeatedDrivingOrderPlan = $drivingOrder->getRepeatedDrivingOrderPlan(); if (isset($repeatedDrivingOrderPlan)) { $dto->parentId = $repeatedDrivingOrderPlan->getId(); } else { $dto->parentId = null; } $dto->notice = null; return $dto; }