} $child->setId($_POST["idChild"]); $child->setNames($_POST["nameChild"]); $child->setLastname1($_POST["lastname1Child"]); $child->setLastname2($_POST["lastname2Child"]); $defuntion = new Defuntion(); $defuntion->setId($_POST["idDefuntion"]); $defuntion->setDeadDate(DatabaseManager::singleDateToDatabaseDate($_POST["celebrationDate"])); $defuntion->setIdChurch($church->getId()); $defuntion->setIdOwner($child->getId()); //Get the defuntion Crypt if ($_POST["idCrypt"] == '0') { if ($_POST["inCrypt"] == "true") { $myCrypt = new Crypt(); $myCrypt->setIdNiche($church->getIdNiche()); $myCrypt->setCol($_POST["cryptColumn"]); $myCrypt->setRow($_POST["cryptRow"]); $myCrypt->setNumber($_POST["cryptNumber"]); DefuntionManager::addCrypt($myCrypt); $singleCrypt = DefuntionManager::getSingleCrypt('col', $myCrypt->getCol(), 'row', $myCrypt->getRow(), 'idNiche', $myCrypt->getIdNiche(), 'number', $myCrypt->getNumber()); $defuntion->setIdCrypt($singleCrypt->getId()); } else { $defuntion->setIdCrypt(NULL); } } else { if ($_POST["inCrypt"] == "true") { $myCrypt = DefuntionManager::getSingleCrypt('id', $_POST["idCrypt"]); $myCrypt->setIdNiche($church->getIdNiche()); $myCrypt->setCol($_POST["cryptColumn"]); $myCrypt->setRow($_POST["cryptRow"]); $myCrypt->setNumber($_POST["cryptNumber"]);