/** * 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()); }
/** * Add a relationship by defining the child and parents * * @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 ChildAndParentsRelationshipState */ public function addChildAndParents(PersonState $child, PersonState $father = null, PersonState $mother = null, StateTransitionOption $option = null) { $rel = new ChildAndParentsRelationship(); $rel->setChild($child->getResourceReference()); if ($father != null) { $rel->setFather($father->getResourceReference()); } if ($mother != null) { $rel->setMother($mother->getResourceReference()); } return $this->passOptionsTo('addChildAndParentsRelationship', array($rel), func_get_args()); }
/** * Adds a spouse relationship between the two persons and applies the specified fact. * * @param PersonState $person1 * @param PersonState $person2 * @param Fact $fact * @param StateTransitionOption $option,... * * @return RelationshipState|null */ public function addSpouseRelationship(PersonState $person1, PersonState $person2, Fact $fact = null, StateTransitionOption $option = null) { $relationship = new Relationship(); $relationship->setPerson1($person1->getResourceReference()); $relationship->setPerson2($person2->getResourceReference()); $relationship->setKnownType(RelationshipType::COUPLE); if ($fact != null) { $relationship->addFact($fact); } return $this->passOptionsTo('addRelationship', array($relationship), func_get_args()); }