Inheritance: extends AuthenticatedBaseRequest
Exemplo n.º 1
0
 /**
  *
  * Follow User
  *
  * @param string|API\Response\Model\User $userId User or User Id to Follow
  * @return API\Response\CreateFriendshipResponse
  * @throws Exception
  */
 public function followUser($userId)
 {
     if (!$this->isLoggedIn()) {
         throw new InstagramException("You must be logged in to call followUser().");
     }
     if ($userId instanceof User) {
         $userId = $userId->getPk();
     }
     $request = new CreateFriendshipRequest($this, $userId);
     $response = $request->execute();
     if (!$response->isOk()) {
         throw new InstagramException(sprintf("Failed to followUser: [%s] %s", $response->getStatus(), $response->getMessage()));
     }
     return $response;
 }
 /**
  *
  * Follow User
  *
  * @param string|API\Response\Model\User $userId User or User Id to Follow
  * @return API\Response\CreateFriendshipResponse
  * @throws Exception
  */
 public function followUser($userId)
 {
     if (!$this->isLoggedIn()) {
         throw new InstagramException("You must be logged in to call followUser().");
     }
     if ($userId instanceof User) {
         $userId = $userId->getPk();
     }
     $request = new CreateFriendshipRequest($this, $userId);
     $response = $request->execute();
     return $response;
 }