public function unfriend() { $profileID = getIdFromURL(); $user = UserRepository::getUserByID($profileID); checkRequestURL($profileID, $user); $myID = UserRepository::getIdByUsername($_SESSION['username']); FriendRepository::unfriend($myID, $profileID); redirect(Route::get("userProfile")->generate(array("id" => $profileID))); }
public function action() { $id = getIdFromURL(); $user = UserRepository::getUserByID($id); checkRequestURL($id, $user); $tweets = TweetRepository::getMyTweets($id); $userGalleries = GalleryRepository::getUserGalleries($id); $userPhotos = array(); foreach ($userGalleries as $gallery) { $photos = PhotoRepository::getPhotosByGalleryID($gallery['galleryid']); foreach ($photos as $photo) { array_push($userPhotos, $photo); } } $main = new Main(); $body = new \templates\TwitterWall(); $body->setTweets($tweets)->setUserPhotos($userPhotos); echo $main->setPageTitle("TwitterApp")->setBody($body); }