function createPerson($tempPersonDTO) { try { self::openConn(); $this->con->beginTransaction(); $person_id = PersonDAO::createPerson($this->con, $tempPersonDTO); //CHECK HERE IF DTOs ARE EMPTY??? $phoneDTO = $tempPersonDTO->getPhoneDTO(); $phoneDTO->setPersonID($person_id); $addressDTO = $tempPersonDTO->getAddrDTO(); $addressDTO->setPersonID($person_id); $phone_id = PhoneDAO::createPhone($this->con, $phoneDTO); $address_id = AddressDAO::createAddress($this->con, $addressDTO); $return = new PersonsDTO($person_id, "CREATED"); $this->con->commit(); self::closeConn(); return $return; } catch (PDOException $e) { $this->con->rollBack(); } }