/**
  * Display formular for one training
  * @param TrainingObject $SingleObject
  */
 protected function displaySingleFormularFor(TrainingObject $SingleObject)
 {
     if ($SingleObject->Weather()->isEmpty()) {
         $SingleObject->setWeatherForecast();
     }
     $Formular = new TrainingFormular($SingleObject, StandardFormular::$SUBMIT_MODE_CREATE);
     $Formular->setId('training');
     $Formular->setLayoutForFields(FormularFieldset::$LAYOUT_FIELD_W50);
     $Formular->display();
 }
Пример #2
0
 /**
  * Insert training
  * @param int $i
  */
 protected function insertTraining($i)
 {
     if (!isset($_POST['training-data'][$i])) {
         return;
     }
     $Data = unserialize(urldecode($_POST['training-data'][$i]));
     $Training = new TrainingObject(DataObject::$DEFAULT_ID);
     $Training->setFromArray($Data);
     $Training->setWeatherForecast();
     $Training->insert();
     $this->InsertedIDs[] = $Training->id();
 }