/** * Restores the specified change if it had been reverted. * * @param \Gedcomx\Atom\Entry $change * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @throws \Gedcomx\Rs\Client\Exception\GedcomxApplicationException * @return ChangeHistoryState | null */ public function restoreChange(Entry $change, StateTransitionOption $option = null) { $link = $change->getLink(Rel::RESTORE); if ($link == null || $link->getHref() == null) { throw new GedcomxApplicationException("Unrestorable change: " . $change->getId()); } $request = $this->createAuthenticatedRequest('POST', $link->getHref(), FamilySearchRequest::getMediaTypes()); return $this->stateFactory->createState('ChangeHistoryState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }
/** * Declares the match status for the current person the specified search result entry. * * @param Entry $entry * @param string $status * @param StateTransitionOption $options * @return PersonMatchResultsState */ public function updateMatchStatus(Entry $entry, $status, StateTransitionOption $options = null) { $updateStatusUri = $this->getSelfUri(); $entity = new Gedcomx(); $person = new Person(); $id = new Identifier(); $id->setType(IdentifierType::PERSISTENT); $id->setValue($entry->getId()); $person->setIdentifiers(array($id)); $entity->setPersons(array($person)); $request = $this->createAuthenticatedGedcomxRequest("POST", $updateStatusUri, [], null, $entity->toJson()); $request = $request->withoutHeader("Accept"); return $this->stateFactory->createState("PersonMatchResultsState", $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }