Exemplo n.º 1
0
 /**
  * @param Passenger $passenger
  * @param $pickupDate
  * @param $pickupTime
  * @param null $companion
  * @param null $memo
  * @param int $status
  * @param bool $manualRoute
  * @param null $additionalTime
  * @return DrivingOrder
  */
 public static function registerDrivingOrder(Passenger $passenger, $pickupDate, $pickupTime, $companion = null, $memo = null, $status = self::BOOKED, $manualRoute = false, $additionalTime = null)
 {
     $correctedCompanion = null !== $companion ? $companion : 0;
     $correctedAdditionalTime = null !== $additionalTime ? $additionalTime : 0;
     $drivingOrder = new DrivingOrder();
     $drivingOrder->assignPassenger($passenger);
     $drivingOrder->setPickUpDate($pickupDate);
     $drivingOrder->setPickUpTime($pickupTime);
     $drivingOrder->setSortOrder($drivingOrder->buildSortOrder($pickupDate, $pickupTime));
     $drivingOrder->setCompanion($correctedCompanion);
     $drivingOrder->setStatus($status);
     $drivingOrder->setManualRoute($manualRoute);
     $drivingOrder->setMemo($memo);
     $drivingOrder->setAdditionalTime($correctedAdditionalTime);
     return $drivingOrder;
 }