function deletePerson($person_id) { self::openConn(); $this->con->beginTransaction(); try { PhoneDAO::deletePhone($this->con, $person_id); AddressDAO::deleteAddress($this->con, $person_id); $result = PersonDAO::deletePerson($this->con, $person_id); $return = new ResultDTO($result, "DELETED"); $json = json_encode($return); echo $json; $this->con->commit(); self::closeConn(); } catch (PDOException $e) { $sql_phone = "<br>" . $e->getMessage(); $this->con->rollBack(); } }
function deletePerson($person_id) { self::openConn(); try { $this->con->beginTransaction(); PhoneDAO::deletePhone($this->con, $person_id); AddressDAO::deleteAddress($this->con, $person_id); $result = PersonDAO::deletePerson($this->con, $person_id); $returnDTO = new ResultDTO($result, "DELETED"); $this->con->commit(); } catch (PDOException $e) { $error_msg = $e->getMessage(); $returnDTO = NULL; $this->con->rollBack(); } self::closeConn(); return $returnDTO; }