public function confirmFriendshipModel($notificationId, $userForm) { $formObjRaw = new FormDTO(CONFIRM_FRIENDSHIP_FORM, $userForm); $formObjRaw->setSubElementId($notificationId); try { $formDataObj = $formObjRaw->getFormData(); $friendDAO = new FriendsDAO(); $result = $friendDAO->confirmFriendship($formDataObj[CONFIRM_FRIENDSHIP_FORM . FRIENDID]); $userDAO = new UserDAO(); $friendDTO = $userDAO->getUserByUserId($formDataObj[CONFIRM_FRIENDSHIP_FORM . FRIENDID]); $friendDTO->setPassword(NULL); $notificationDAO = new NotificationDAO(); $result = $notificationDAO->setNotificationAsRead($formDataObj[CONFIRM_FRIENDSHIP_FORM . NOTIFICATIONID]); SessionUtils::addFriendInUserLoggedFriendList($friendDTO, date(DATE_FORMAT)); DataModelUtils::notifyAction($friendDTO->getUserId() . SEPARATOR . $friendDTO->getUserName(), CONFIRM_FRIENDSHIP_FORM); return $friendDTO; } catch (PDOException $pdoe) { throw $pdoe; } catch (Exception $e) { throw $e; } }