/** * 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); }
/** * Update notes added to a person. * * @param \Gedcomx\Conclusion\Person $person * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @return \Gedcomx\Rs\Client\PersonState */ public function updatePersonNotes(Person $person, StateTransitionOption $option = null) { $target = $this->getSelfUri(); $conclusionsLink = $this->getLink(Rel::NOTES); if ($conclusionsLink != null && $conclusionsLink->getHref() != null) { $target = $conclusionsLink->getHref(); } $gx = new Gedcomx(); $gx->setPersons(array($person)); /** @var EntityEnclosingRequest $request */ $request = $this->createAuthenticatedGedcomxRequest('POST', $target, [], null, $gx->toJson()); return $this->stateFactory->createState('PersonState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }
/** * Update the discussion references on a Person object * * @param \Gedcomx\Conclusion\Person $person * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @return FamilyTreePersonState */ public function updatePersonDiscussionReferences(Person $person, StateTransitionOption $option = null) { $target = $this->getSelfUri(); $link = $this->getLink(Rel::DISCUSSION_REFERENCES); if ($link != null && $link->getHref() != null) { $target = $link->getHref(); } $gx = new Gedcomx(); $gx->setPersons(array($person)); $request = $this->createAuthenticatedRequest('POST', $target, FamilySearchRequest::getMediaTypes(), null, $gx->toJson()); return $this->stateFactory->createState('PersonState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }