/** * 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); }
/** * Initializes this Subject from an associative array * * @param array $o */ public function initFromArray(array $o) { if (isset($o['extracted'])) { $this->extracted = $o["extracted"]; unset($o['extracted']); } $this->evidence = array(); if (isset($o['evidence'])) { foreach ($o['evidence'] as $i => $x) { $this->evidence[$i] = new EvidenceReference($x); } unset($o['evidence']); } $this->media = array(); if (isset($o['media'])) { foreach ($o['media'] as $i => $x) { $this->media[$i] = new SourceReference($x); } unset($o['media']); } $this->identifiers = array(); if (isset($o['identifiers'])) { $this->identifiers = array(); foreach ($o['identifiers'] as $i => $x) { if (!is_array($x)) { $x = array($x); } foreach ($x as $idValue) { $identifier = new Identifier(); $identifier->setType($i); $identifier->setValue($idValue); array_push($this->identifiers, $identifier); } } unset($o['identifiers']); } parent::initFromArray($o); }