/** * Is the comment deletable * * Checks if a comment is deletable by checking if the current user posted the comment * or if the comment was added to one of the current user's media * * @param \Instagram\Comment $comment The comment * @param \Instagram\Media $media The media the comment was added to * @param \Instagram\CurrentUser $current_user Current user * @access public */ public static function commentIsDeletable(\Instagram\Comment $comment, \Instagram\Media $media, \Instagram\CurrentUser $current_user) { return $comment->getUser()->getId() == $current_user->getId() || $media->getUser()->getId() == $current_user->getId(); }
/** * Does the current use like a media * * @param \Instagram\Media $media Media to query for a like from the current user * @access public */ public function likes(\Instagram\Media $media) { return isset($this->liked[$media->getId()]) || isset($media->getData()->user_has_liked) && (bool) $media->getData()->user_has_liked === true && !isset($this->unliked[$media->getId()]); }