Instagram\Instagram::getMediaComments PHP Method

getMediaComments() public method

Get Media Comments
public getMediaComments ( string | FeedItem $mediaId, string $maxId ) : CommentsMediaResponse
$mediaId string | Instagram\API\Response\Model\FeedItem FeedItem or FeedItem Id of Media to get Comments from
$maxId string Next Maximum Id, used for Pagination
return Instagram\API\Response\CommentsMediaResponse
    public function getMediaComments($mediaId, $maxId)
    {
        if (!$this->isLoggedIn()) {
            throw new InstagramException("You must be logged in to call getMediaComments().");
        }
        if ($mediaId instanceof FeedItem) {
            $mediaId = $mediaId->getPk();
        }
        $request = new CommentsMediaRequest($this, $mediaId, $maxId);
        $response = $request->execute();
        if (!$response->isOk()) {
            throw new InstagramException(sprintf("Failed to getMediaComments: [%s] %s", $response->getStatus(), $response->getMessage()));
        }
        return $response;
    }