Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }