execute() public method

public execute ( ) : Instagram\API\Response\LikeMediaResponse
return Instagram\API\Response\LikeMediaResponse
Exemplo n.º 1
0
 /**
  *
  * Like Media
  *
  * @param string|API\Response\Model\FeedItem $mediaId FeedItem or FeedItem Id to Like
  * @return API\Response\LikeMediaResponse
  * @throws Exception
  */
 public function likeMedia($mediaId)
 {
     if (!$this->isLoggedIn()) {
         throw new InstagramException("You must be logged in to call likeMedia().");
     }
     if ($mediaId instanceof FeedItem) {
         $mediaId = $mediaId->getPk();
     }
     $request = new LikeMediaRequest($this, $mediaId);
     $response = $request->execute();
     if (!$response->isOk()) {
         throw new InstagramException(sprintf("Failed to likeMedia: [%s] %s", $response->getStatus(), $response->getMessage()));
     }
     return $response;
 }
 /**
  *
  * Like Media
  *
  * @param string|API\Response\Model\FeedItem $mediaId FeedItem or FeedItem Id to Like
  * @return API\Response\LikeMediaResponse
  *
  */
 public function likeMedia($mediaId)
 {
     if (!$this->isLoggedIn()) {
         throw new InstagramException("You must be logged in to call likeMedia().");
     }
     if ($mediaId instanceof FeedItem) {
         $mediaId = $mediaId->getPk();
     }
     $request = new LikeMediaRequest($this, $mediaId);
     $response = $request->execute();
     return $response;
 }