Exemplo n.º 1
0
         array_push($aptListInject, $apatObj);
     }
 }
 $sklListInject = array();
 foreach ($_SESSION['skillList'] as $n) {
     $name_spaceless = str_replace(" ", "_", $n->name);
     if (isset($_POST['check_' . $name_spaceless])) {
         $skillObj = $epListP->getSkillByNamePrefix($_POST['check_' . $name_spaceless], $_POST['prefix_' . $name_spaceless], $_SESSION['aptList']);
         $skillObj->baseValue = $_POST['val_' . $name_spaceless];
         array_push($sklListInject, $skillObj);
     }
 }
 $statListInject = array();
 foreach ($_SESSION['statList'] as $o) {
     if (isset($_POST['check_' . $o->abbreviation])) {
         $statObj = $epListP->getStatByName($_POST['check_' . $o->abbreviation]);
         $statObj->value = $_POST['val_' . $o->abbreviation];
         array_push($statListInject, $statObj);
     }
 }
 if ($_POST['unique'] == "Y") {
     $u = true;
 } else {
     $u = false;
 }
 $aiObj = new EPAi($_POST['name'], $aptListInject, $_POST['costType'], $sklListInject, $statListInject, $_POST['desc']);
 $aiObj->unique = $u;
 if (!$persistManager->persistAi($aiObj)) {
     echo $persistManager->getLastError();
     echo "<br><br>";
 } else {