/** * Reads the person from the specified person model. * * @param \Gedcomx\Conclusion\Person $person * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @return PersonState|null */ public function readPersonFromConclusion(Person $person, StateTransitionOption $option = null) { $link = $person->getLink(Rel::PERSON); if ($link === null) { $link = $person->getLink(Rel::SELF); } if ($link === null || $link->getHref() === null) { return null; } $request = $this->createAuthenticatedGedcomxRequest("GET", $link->getHref()); return $this->stateFactory->createState("PersonState", $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }
/** * Removes the declared non match person from this collection. * * @param \Gedcomx\Conclusion\Person $nonMatch * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @return mixed|null */ public function removeNonMatch(Person $nonMatch, StateTransitionOption $option = null) { $link = $nonMatch->getLink(Rel::NOT_A_MATCHES); if ($link == null || $link->getHref() == null) { return null; } $request = $this->createAuthenticatedRequest('DELETE', $link->getHref(), FamilySearchRequest::getMediaTypes()); return $this->stateFactory->createState('PersonNonMatchesState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }
/** * Read the Decendancy based on this spouse * * @param \Gedcomx\Conclusion\Person $person * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @return \Gedcomx\Rs\Client\PersonState|null */ public function readDescendancyWithSpouse(Person $person, StateTransitionOption $option = null) { $link = $person->getLink(Rel::DESCENDANCY); if ($link == null || $link->getHref() == null) { return null; } $request = $this->createAuthenticatedGedcomxRequest('GET', $link->getHref()); return $this->stateFactory->createState('PersonState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }