/** * Delete a discussion reference * * @param \Gedcomx\Extensions\FamilySearch\Platform\Tree\DiscussionReference $reference * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @throws \Gedcomx\Rs\Client\Exception\GedcomxApplicationException * @return FamilyTreePersonState */ public function deleteDiscussionReference(DiscussionReference $reference, StateTransitionOption $option = null) { $link = null; if ($reference->getLinks() != null) { $link = $reference->getLink(Rel::DISCUSSION_REFERENCE); if ($link == null) { $link = $reference->getLink(Rel::SELF); } } if ($link == null) { $link = new Link(); $link->setHref($reference->getResource()); } if ($link == null || $link->getHref() == null) { throw new GedcomxApplicationException("Discussion reference cannot be deleted: missing link."); } $request = $this->createAuthenticatedRequest('DELETE', $link->getHref(), FamilySearchRequest::getMediaTypes()); return $this->stateFactory->createState('PersonState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }