/** * 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()); }
/** * 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()); }
/** * 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()); }