/** * * Comment on Media * * @param string|API\Response\Model\FeedItem $mediaId FeedItem or FeedItem Id to Comment on * @param string $comment Comment * @return API\Response\CommentMediaResponse * @throws Exception */ public function commentOnMedia($mediaId, $comment) { if (!$this->isLoggedIn()) { throw new InstagramException("You must be logged in to call commentOnMedia()."); } if ($mediaId instanceof FeedItem) { $mediaId = $mediaId->getPk(); } $request = new CommentMediaRequest($this, $mediaId, $comment); $response = $request->execute(); if (!$response->isOk()) { throw new InstagramException(sprintf("Failed to commentOnMedia: [%s] %s", $response->getStatus(), $response->getMessage())); } return $response; }
/** * * Comment on Media * * @param string|API\Response\Model\FeedItem $mediaId FeedItem or FeedItem Id to Comment on * @param string $comment Comment * @return API\Response\CommentMediaResponse * @throws Exception */ public function commentOnMedia($mediaId, $comment) { if (!$this->isLoggedIn()) { throw new InstagramException("You must be logged in to call commentOnMedia()."); } if ($mediaId instanceof FeedItem) { $mediaId = $mediaId->getPk(); } $request = new CommentMediaRequest($this, $mediaId, $comment); $response = $request->execute(); return $response; }