$celb = DatabaseManager::singleDateToDatabaseDate($_POST["celebrationDate"]);
$marriage->setCelebrationDate($celb);
$marriage->setIdChurchProcess($churchProcess->getId());
$marriage->setIdChurchMarriage($churchMarriage->getId());
$marriage->setIdRector($_POST["rectorId"]);
if ($boyfriend->getId() === '0') {
    PersonManager::addPerson($boyfriend, 'true');
    $boyfriend = PersonManager::getSinglePerson('id', PersonManager::getLastID());
} else {
    PersonManager::updatePerson($boyfriend);
}
if ($girlfriend->getId() === '0') {
    PersonManager::addPerson($girlfriend, 'true');
    $girlfriend = PersonManager::getSinglePerson('id', PersonManager::getLastID());
} else {
    PersonManager::updatePerson($girlfriend);
}
$marriage->setIdBoyfriend($boyfriend->getId());
$marriage->setIdGirlfriend($girlfriend->getId());
//Process The GodFather
if ($_POST["nameGodFather"] !== '') {
    $godFather = PersonManager::getSinglePerson('names', $_POST["nameGodFather"], 'lastname1', $_POST["lastname1GodFather"], 'lastname2', $_POST["lastname2GodFather"]);
    if ($godFather === NULL) {
        $godFather = new Person();
        $godFather->setNames($_POST["nameGodFather"]);
        $godFather->setLastname1($_POST["lastname1GodFather"]);
        $godFather->setLastname2($_POST["lastname2GodFather"]);
        $godFather->setGender('M');
        PersonManager::addPerson($godFather, 'true');
        $godFather = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
        $mother->setNames($_POST["nameMother"]);
        $mother->setLastname1($_POST["lastname1Mother"]);
        $mother->setLastname2($_POST["lastname2Mother"]);
        $mother->setGender('F');
        PersonManager::addPerson($mother, 'true');
        $mother = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
}
//Process The Child
$child->setIdFather($father->getId());
$child->setIdMother($mother->getId());
if ($child->getId() === '0') {
    PersonManager::addPerson($child, 'true');
    $child = PersonManager::getSinglePerson('id', PersonManager::getLastID());
} else {
    PersonManager::updatePerson($child);
}
$proof->setIdOwner($child->getId());
//Process The GodFather
if ($_POST["nameGodFather"] !== '') {
    $godFather = PersonManager::getSinglePerson('names', $_POST["nameGodFather"], 'lastname1', $_POST["lastname1GodFather"], 'lastname2', $_POST["lastname2GodFather"]);
    if ($godFather === NULL) {
        $godFather = new Person();
        $godFather->setNames($_POST["nameGodFather"]);
        $godFather->setLastname1($_POST["lastname1GodFather"]);
        $godFather->setLastname2($_POST["lastname2GodFather"]);
        $godFather->setGender('M');
        PersonManager::addPerson($godFather, 'true');
        $godFather = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
    $proof->setIdGodFather($godFather->getId());