/** * Deletes the specified comment from the current discussion. * * @param Comment $comment * @param StateTransitionOption $option,... * * @return DiscussionState * @throws GedcomxApplicationException */ public function deleteComment(Comment $comment, StateTransitionOption $option = null) { $link = $comment->getLink(Rel::COMMENT); $link = $link == null ? $comment->getLink(Rel::SELF) : $link; if ($link == null || $link->getHref() == null) { throw new GedcomxApplicationException("Comment cannot be deleted: missing {$link}."); } $request = $this->createAuthenticatedGedcomxRequest('DELETE', $link->getHref(), FamilySearchRequest::getMediaTypes()); return $this->stateFactory->createState('DiscussionState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }