示例#1
0
 /**
  * @param $name
  * @param Address $address
  * @param null $memo
  * @return \Tixi\CoreDomain\VehicleDepot
  */
 public static function registerVehicleDepot($name, Address $address, $memo = null)
 {
     $vehicleDepot = new VehicleDepot();
     $vehicleDepot->setName($name);
     $vehicleDepot->setMemo($memo);
     $vehicleDepot->assignAddress($address);
     return $vehicleDepot;
 }
 /**
  * @param VehicleDepot $vehicleDepot
  * @return VehicleDepotListDTO
  */
 public function toVehicleDepotListDTO(VehicleDepot $vehicleDepot)
 {
     $vehicleDepotListDTO = new VehicleDepotListDTO();
     $vehicleDepotListDTO->id = $vehicleDepot->getId();
     $vehicleDepotListDTO->name = $vehicleDepot->getName();
     $vehicleDepotListDTO->street = $vehicleDepot->getAddress()->getStreet();
     $vehicleDepotListDTO->city = $vehicleDepot->getAddress()->getCity();
     return $vehicleDepotListDTO;
 }