$godMother = PersonManager::getSinglePerson('id', PersonManager::getLastID()); } $marriage->setIdGodMother($godMother->getId()); } //Process The Witness1 if ($_POST["nameWitness1"] !== '') { $witness1 = PersonManager::getSinglePerson('names', $_POST["nameWitness1"], 'lastname1', $_POST["lastname1Witness1"], 'lastname2', $_POST["lastname2Witness1"]); if ($witness1 === NULL) { $witness1 = new Person(); $witness1->setNames($_POST["nameWitness1"]); $witness1->setLastname1($_POST["lastname1Witness1"]); $witness1->setLastname2($_POST["lastname2Witness1"]); PersonManager::addPerson($witness1, 'true'); $witness1 = PersonManager::getSinglePerson('id', PersonManager::getLastID()); } $marriage->setIdWitness1($witness1->getId()); } //Process The Witness1 if ($_POST["nameWitness2"] !== '') { $witness2 = PersonManager::getSinglePerson('names', $_POST["nameWitness2"], 'lastname1', $_POST["lastname1Witness2"], 'lastname2', $_POST["lastname2Witness2"]); if ($witness2 === NULL) { $witness2 = new Person(); $witness2->setNames($_POST["nameWitness2"]); $witness2->setLastname1($_POST["lastname1Witness2"]); $witness2->setLastname2($_POST["lastname2Witness2"]); PersonManager::addPerson($witness2, 'true'); $witness2 = PersonManager::getSinglePerson('id', PersonManager::getLastID()); } $marriage->setIdWitness2($witness2->getId()); } //Get The Book Registry Data