/**
  * @param VehicleCategory $vehicleCategory
  * @return VehicleCategoryListDTO
  */
 public function toVehicleCategoryListDTO(VehicleCategory $vehicleCategory)
 {
     $vehicleCategoryListDTO = new VehicleCategoryListDTO();
     $vehicleCategoryListDTO->id = $vehicleCategory->getId();
     $vehicleCategoryListDTO->name = $vehicleCategory->getName();
     $vehicleCategoryListDTO->amountOfSeats = $vehicleCategory->getAmountOfSeats();
     $vehicleCategoryListDTO->amountOfWheelChairs = $vehicleCategory->getAmountOfWheelChairs();
     return $vehicleCategoryListDTO;
 }
Пример #2
0
 /**
  * drives certain vehicle categories
  * @param VehicleCategory $vehicleCategory
  * @return bool
  */
 public function isCompatibleWithVehicleCategory(VehicleCategory $vehicleCategory)
 {
     /**@var $contradict VehicleCategory */
     foreach ($this->contradictVehicleCategories as $contradict) {
         if ($vehicleCategory->getId() === $contradict->getId()) {
             return false;
         }
     }
     return true;
 }
Пример #3
0
 /**
  * @param VehicleCategory $vehicleCategory
  * @return bool
  */
 public function isCompatibleWithVehicleCategory(VehicleCategory $vehicleCategory)
 {
     if ($this->isInWheelChair) {
         if ($vehicleCategory->getAmountOfWheelChairs() < 1) {
             return false;
         }
     }
     /**@var $contradict VehicleCategory */
     foreach ($this->contradictVehicleCategories as $contradict) {
         if ($vehicleCategory->getId() === $contradict->getId()) {
             return false;
         }
     }
     return true;
 }