public function validate()
 {
     if (is_null($this->licensePlate)) {
         throw new RequiredFieldMissingException('CreateRegistrationRequest', 'licensePlate');
     }
     if (is_null($this->subdivisionId)) {
         throw new RequiredFieldMissingException('CreateRegistrationRequest', 'subdivisionId');
     }
     /**
      * Validate expected data types
      */
     if (!is_null($this->issuedDate)) {
         if (!DateUtil::validate($this->issuedDate, 'YYYY-MM-DD')) {
             throw new EntityValidationException('CreateRegistrationRequest', 'issuedDate', 'YYYY-MM-DD required', $this->issuedDate);
         }
     }
     if (!is_null($this->expirationDate)) {
         if (!DateUtil::validate($this->expirationDate, 'YYYY-MM-DD')) {
             throw new EntityValidationException('CreateRegistrationRequest', 'expirationDate', 'YYYY-MM-DD required', $this->expirationDate);
         }
     }
     if (is_null(InputUtil::getInt($this->subdivisionId))) {
         throw new EntityValidationException('CreateRegistrationRequest', 'subdivisionId', 'Expected integer value', $this->subdivisionId);
     }
 }
 public function validate()
 {
     /**
      * Validate required fields
      */
     if (is_null($this->startDate)) {
         throw new RequiredFieldMissingException('CreateSeasonRequest', 'startDate');
     }
     if (is_null($this->endDate)) {
         throw new RequiredFieldMissingException('CreateSeasonRequest', 'endDate');
     }
     if (is_null($this->name)) {
         throw new RequiredFieldMissingException('CreateSeasonRequest', 'name');
     }
     /**
      * Validate expected data types
      */
     if (!DateUtil::validate($this->startDate, 'YYYY-MM-DD')) {
         throw new EntityValidationException('CreateSeasonRequest', 'startDate', 'YYYY-MM-DD required', $this->startDate);
     }
     if (!DateUtil::validate($this->endDate, 'YYYY-MM-DD')) {
         throw new EntityValidationException('CreateSeasonRequest', 'endDate', 'YYYY-MM-DD required', $this->endDate);
     }
     if (!is_string($this->name)) {
         throw new EntityValidationException('CreateSeasonRequest', 'name', 'string expected', $this->name);
     }
 }
 public function validate()
 {
     /**
      * Validate required fields
      */
     if (is_null($this->userId)) {
         throw new RequiredFieldMissingException('CreateReservationRequest', 'userId');
     }
     if (is_null($this->vendorId)) {
         throw new RequiredFieldMissingException('CreateReservationRequest', 'vendorId');
     }
     if (is_null($this->serviceIds)) {
         throw new RequiredFieldMissingException('CreateReservationRequest', 'serviceIds');
     }
     if (is_null($this->startDate)) {
         throw new RequiredFieldMissingException('CreateReservationRequest', 'startDate');
     }
     if (is_null($this->endDate)) {
         throw new RequiredFieldMissingException('CreateReservationRequest', 'endDate');
     }
     /**
      * Validate expected data types
      */
     if (is_null(InputUtil::getInt($this->userId))) {
         throw new EntityValidationException('CreateReservationRequest', 'userId', 'Expected integer value', $this->userId);
     }
     if (is_null(InputUtil::getInt($this->vendorId))) {
         throw new EntityValidationException('CreateReservationRequest', 'vendorId', 'Expected numeric value', $this->vendorId);
     }
     if (DU::validate($this->startDate, 'YYYY-MM-DD') === false) {
         throw new EntityValidationException('CreateReservationRequest', 'startDate', 'Expected YYYY-MM-DD format', $this->startDate);
     }
     if (DU::validate($this->endDate, 'YYYY-MM-DD') === false) {
         throw new EntityValidationException('CreateReservationRequest', 'endDate', 'Expected YYYY-MM-DD format', $this->endDate);
     }
     $serviceIds = explode(',', $this->serviceIds);
     $newItems = [];
     foreach ($serviceIds as $item) {
         $item = trim($item);
         $tempItem = InputUtil::getInt($item);
         if (is_null($tempItem)) {
             throw new EntityValidationException('CreateReservationRequest', 'serviceIds', 'Expected integer value for item', $tempItem);
         }
         $newItems[] = $tempItem;
     }
     $this->serviceIds = implode(',', $newItems);
 }
 public function clean()
 {
     $this->ids = IU::getIdsString($this->ids);
     $this->published = BU::getBooleanValue($this->published);
     $this->vendorIds = IU::getIdsString($this->vendorIds);
     $this->fromDate = DU::validate($this->fromDate, 'YYYY-MM-DD') ? $this->fromDate : null;
     $this->toDate = DU::validate($this->toDate, 'YYYY-MM-DD') ? $this->toDate : null;
     $this->vehicleIds = IU::getIdsString($this->vehicleIds);
     $this->vehicleTypeIds = IU::getIdsString($this->vehicleTypeIds);
     $this->vehicleClassIds = IU::getIdsString($this->vehicleClassIds);
     $this->vehicleMakeIds = IU::getIdsString($this->vehicleMakeIds);
     $this->vehicleModelIds = IU::getIdsString($this->vehicleModelIds);
     $this->fuelTypeIds = IU::getIdsString($this->fuelTypeIds);
     $this->transmissionIds = IU::getIdsString($this->transmissionIds);
     $this->limit = IU::getInt($this->limit);
     $this->page = IU::getInt($this->page);
 }