function deleteFriendModel($friendId) { try { $responseDTO = new ResponseDTO(DELETE_FRIEND_FORM); $friendsDAO = new FriendsDAO(); $oldFriend = $friendsDAO->deleteFriend($friendId); SessionUtils::deleteFriendInUserLoggedFriendList($friendId); $responseDTO->setResponseSucc("friend" . $friendId); return $responseDTO; } catch (PDOException $pdoe) { throw $pdoe; } catch (UserNotAuthenticatedExceptionDTO $authExp) { throw $authExp; } catch (Exception $e) { throw $e; } }
public function denyFriendshipModel($notificationId, $userForm) { $formObjRaw = new FormDTO(DENY_FRIENDSHIP_FORM, $userForm); $formObjRaw->setSubElementId($notificationId); try { $formDataObj = $formObjRaw->getFormData(); $friendDAO = new FriendsDAO(); $friendId = $friendDAO->deleteFriend($formDataObj[DENY_FRIENDSHIP_FORM . FRIENDID]); $notificationDAO = new NotificationDAO(); $notificationDAO->deleteNotificationByNotificationId($notificationId); $responseDTO = new ResponseDTO(DENY_REGISTRATION_FORM); $responseDTO->setResponseSucc($notificationId); return $notificationId; } catch (PDOException $pdoe) { throw $pdoe; } catch (Exception $e) { throw $e; } }