/** * Add a new relationship to the collection * * @param \Gedcomx\Conclusion\Relationship $relationship * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,... * * @return \Gedcomx\Rs\Client\RelationshipState|null * @throws GedcomxApplicationException */ public function addRelationship(Relationship $relationship, StateTransitionOption $option = null) { if ($relationship->getKnownType() == RelationshipType::PARENTCHILD) { throw new GedcomxApplicationException("FamilySearch Family Tree doesn't support adding parent-child relationships. You must instead add a child-and-parents relationship."); } return parent::addRelationship($relationship); }
private function getRootCollection(FamilySearchCollectionState $collection) { $subcollections = $collection->readSubcollections(); $rootUserCollection = null; /** @var Collection $c */ foreach ($subcollections->getEntity()->getCollections() as $c) { if (!$c->getTitle()) { $rootUserCollection = $c; break; } } $this->assertNotNull($rootUserCollection); // Get the root collection $subcollection = $subcollections->readCollection($rootUserCollection); $this->assertEquals(HttpStatus::OK, $subcollection->getResponse()->getStatusCode()); return $subcollection; }