コード例 #1
0
 /**
  * Adds a child and parents relationship to the current relationships collection.
  *
  * @param \Gedcomx\Rs\Client\PersonState                   $child
  * @param \Gedcomx\Rs\Client\PersonState                   $father
  * @param \Gedcomx\Rs\Client\PersonState                   $mother
  * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
  *
  * @return \Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\ChildAndParentsRelationshipState
  */
 public function addChildAndParents(PersonState $child, PersonState $father = null, PersonState $mother = null, StateTransitionOption $option = null)
 {
     $chap = new ChildAndParentsRelationship();
     $chap->setChild(new ResourceReference($child->getSelfUri()));
     if ($father != null) {
         $chap->setFather(new ResourceReference($father->getSelfUri()));
     }
     if ($mother != null) {
         $chap->setMother(new ResourceReference($mother->getSelfUri()));
     }
     return $this->passOptionsTo('addChildAndParentsRelationship', array($chap), func_get_args());
 }
コード例 #2
0
ファイル: PersonState.php プロジェクト: BRGWeb/gedcomx-php
 /**
  * Adds an evidence reference to the current person.
  *
  * @param \Gedcomx\Rs\Client\PersonState                   $person
  * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
  *
  * @return \Gedcomx\Rs\Client\PersonState
  */
 public function addPersonEvidence(PersonState $person, StateTransitionOption $option = null)
 {
     $reference = new EvidenceReference();
     $reference->setResource($person->getSelfUri());
     return $this->passOptionsTo('addEvidenceReferences', array(array($reference)), func_get_args());
 }
コード例 #3
0
 /**
  * Adds a parent child relationship between the two persons and applies the specified fact.
  *
  * @param PersonState $parent
  * @param PersonState $child
  * @param Fact $fact
  * @param StateTransitionOption $option,...
  *
  * @return RelationshipState|null
  */
 public function AddParentChildRelationship(PersonState $parent, PersonState $child, Fact $fact = null, StateTransitionOption $option = null)
 {
     $relationship = new Relationship();
     $relationship->setPerson1(new ResourceReference($parent->getSelfUri()));
     $relationship->setPerson2(new ResourceReference($child->getSelfUri()));
     $relationship->setKnownType(RelationshipType::PARENTCHILD);
     if ($fact != null) {
         $relationship->addFact($fact);
     }
     return $this->passOptionsTo('addRelationship', array($relationship), func_get_args());
 }
コード例 #4
0
 /**
  * Update the mother on this relationship with a PersonState
  *
  * @param \Gedcomx\Rs\Client\PersonState                   $mother
  * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
  *
  * @return ChildAndParentsRelationshipState
  */
 public function updateMotherWithPersonState(PersonState $mother, StateTransitionOption $option = null)
 {
     return $this->passOptionsTo('updateMother', array($mother->getResourceReference()), func_get_args());
 }
コード例 #5
0
 /**
  * Constructs a new person non matches state using the specified client, request, response, access token, and state factory.
  *
  * @param \GuzzleHttp\Client                                                          $client
  * @param \GuzzleHttp\Psr7\Request                                                 $request
  * @param \GuzzleHttp\Psr7\Response                                                $response
  * @param string                                                                       $accessToken
  * @param \Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeStateFactory $stateFactory
  */
 public function __construct(Client $client, Request $request, Response $response, $accessToken, FamilyTreeStateFactory $stateFactory)
 {
     parent::__construct($client, $request, $response, $accessToken, $stateFactory);
 }