Instagram\Instagram::deleteCommentsFromMedia PHP Method

deleteCommentsFromMedia() public method

Delete Media Comments
public deleteCommentsFromMedia ( string | FeedItem $mediaId, array $commentIds ) : API\Response\BulkDeleteCommentsMediaResponse
$mediaId string | Instagram\API\Response\Model\FeedItem FeedItem or FeedItem Id to Delete Comments from
$commentIds array Array of Comment Ids to Delete
return API\Response\BulkDeleteCommentsMediaResponse
    public function deleteCommentsFromMedia($mediaId, $commentIds)
    {
        if (!$this->isLoggedIn()) {
            throw new InstagramException("You must be logged in to call deleteCommentsFromMedia().");
        }
        if ($mediaId instanceof FeedItem) {
            $mediaId = $mediaId->getPk();
        }
        $request = new BulkDeleteCommentsMediaRequest($this, $mediaId, $commentIds);
        $response = $request->execute();
        if (!$response->isOk()) {
            throw new InstagramException(sprintf("Failed to deleteCommentsFromMedia: [%s] %s", $response->getStatus(), $response->getMessage()));
        }
        return $response;
    }