gedcomx-php-client
  • Namespace
  • Class

Namespaces

  • Gedcomx
    • Agent
    • Atom
    • Common
    • Conclusion
    • Extensions
      • FamilySearch
        • Platform
          • Artifacts
          • Discussions
          • Tree
          • Users
        • Rs
          • Client
            • FamilyTree
            • Helpers
            • Memories
            • Util
        • Rt
        • Types
    • GedcomxFile
    • Links
    • Records
    • Rs
      • Client
        • Exception
        • Options
        • Util
    • Rt
    • Search
    • Source
    • Support
    • Types
    • Util
    • Vocab

Classes

  • Gedcomx\Agent\Address
  • Gedcomx\Agent\Agent
  • Gedcomx\Agent\OnlineAccount
  • Gedcomx\Atom\Category
  • Gedcomx\Atom\CommonAttributes
  • Gedcomx\Atom\Content
  • Gedcomx\Atom\Entry
  • Gedcomx\Atom\ExtensibleElement
  • Gedcomx\Atom\Feed
  • Gedcomx\Atom\Generator
  • Gedcomx\Atom\Person
  • Gedcomx\Common\Attribution
  • Gedcomx\Common\CustomEntity
  • Gedcomx\Common\CustomKeyedItem
  • Gedcomx\Common\EvidenceReference
  • Gedcomx\Common\ExtensibleData
  • Gedcomx\Common\Note
  • Gedcomx\Common\Qualifier
  • Gedcomx\Common\ResourceReference
  • Gedcomx\Common\TextValue
  • Gedcomx\Common\UniqueCustomKeyedItem
  • Gedcomx\Conclusion\Conclusion
  • Gedcomx\Conclusion\DateInfo
  • Gedcomx\Conclusion\DisplayProperties
  • Gedcomx\Conclusion\Document
  • Gedcomx\Conclusion\Event
  • Gedcomx\Conclusion\EventRole
  • Gedcomx\Conclusion\Fact
  • Gedcomx\Conclusion\Gender
  • Gedcomx\Conclusion\Identifier
  • Gedcomx\Conclusion\Name
  • Gedcomx\Conclusion\NameForm
  • Gedcomx\Conclusion\NamePart
  • Gedcomx\Conclusion\Person
  • Gedcomx\Conclusion\PlaceDescription
  • Gedcomx\Conclusion\PlaceDisplayProperties
  • Gedcomx\Conclusion\PlaceReference
  • Gedcomx\Conclusion\Relationship
  • Gedcomx\Conclusion\Subject
  • Gedcomx\Extensions\FamilySearch\Error
  • Gedcomx\Extensions\FamilySearch\FamilySearchPlatform
  • Gedcomx\Extensions\FamilySearch\Feature
  • Gedcomx\Extensions\FamilySearch\HealthConfig
  • Gedcomx\Extensions\FamilySearch\Platform\Artifacts\ArtifactMetadata
  • Gedcomx\Extensions\FamilySearch\Platform\Artifacts\ArtifactType
  • Gedcomx\Extensions\FamilySearch\Platform\Discussions\Comment
  • Gedcomx\Extensions\FamilySearch\Platform\Discussions\Discussion
  • Gedcomx\Extensions\FamilySearch\Platform\Error
  • Gedcomx\Extensions\FamilySearch\Platform\HealthConfig
  • Gedcomx\Extensions\FamilySearch\Platform\Tag
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\ChangeInfo
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\ChangeObjectModifier
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\ChangeObjectType
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\ChangeOperation
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\ChildAndParentsRelationship
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\DiscussionReference
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\MatchInfo
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\MatchStatus
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\Merge
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\MergeAnalysis
  • Gedcomx\Extensions\FamilySearch\Platform\Tree\MergeConflict
  • Gedcomx\Extensions\FamilySearch\Platform\Users\User
  • Gedcomx\Extensions\FamilySearch\Rs\Client\DiscussionsState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\DiscussionState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchClient
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchCollectionState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchPlaceDescriptionState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchPlaces
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchPlaceState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchSourceDescriptionState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchStateFactory
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\ChangeHistoryState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\ChildAndParentsRelationshipState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeCollectionState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreePersonChildrenState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreePersonParentsState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreePersonState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeRelationshipsState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeRelationshipState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeStateFactory
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Helpers\FamilySearchRequest
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Memories\FamilySearchMemories
  • Gedcomx\Extensions\FamilySearch\Rs\Client\PersonMatchResultsState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\PersonMergeState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\PersonNonMatchesState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Rel
  • Gedcomx\Extensions\FamilySearch\Rs\Client\UserHistoryState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\UserState
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Util\ChangeEntry
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Util\ChangeHistoryPage
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Util\LoggerMiddleware
  • Gedcomx\Extensions\FamilySearch\Rs\Client\Util\ThrottlingMiddleware
  • Gedcomx\Extensions\FamilySearch\Rt\FamilySearchPlatformLocalReferenceResolver
  • Gedcomx\Extensions\FamilySearch\Rt\FamilySearchPlatformModelVisitorBase
  • Gedcomx\Extensions\FamilySearch\Tag
  • Gedcomx\Extensions\FamilySearch\Types\FactType
  • Gedcomx\Gedcomx
  • Gedcomx\GedcomxFile\DefaultJsonSerialization
  • Gedcomx\GedcomxFile\DefaultXMLSerialization
  • Gedcomx\GedcomxFile\GedcomxFile
  • Gedcomx\GedcomxFile\GedcomxFileEntry
  • Gedcomx\GedcomxFile\GedcomxOutput
  • Gedcomx\GedcomxFile\Manifest
  • Gedcomx\GedcomxFile\ManifestAttribute
  • Gedcomx\Links\HypermediaEnabledData
  • Gedcomx\Links\Link
  • Gedcomx\Records\Collection
  • Gedcomx\Records\CollectionContent
  • Gedcomx\Records\Field
  • Gedcomx\Records\FieldDescriptor
  • Gedcomx\Records\FieldValue
  • Gedcomx\Records\FieldValueDescriptor
  • Gedcomx\Records\RecordDescriptor
  • Gedcomx\Records\RecordSet
  • Gedcomx\Records\RecordSetIterator
  • Gedcomx\Rs\Client\AgentState
  • Gedcomx\Rs\Client\AncestryResultsState
  • Gedcomx\Rs\Client\CollectionsState
  • Gedcomx\Rs\Client\CollectionState
  • Gedcomx\Rs\Client\DescendancyResultsState
  • Gedcomx\Rs\Client\GedcomxApplicationState
  • Gedcomx\Rs\Client\GedcomxSearchQuery
  • Gedcomx\Rs\Client\Options\CacheDirectives
  • Gedcomx\Rs\Client\Options\HeaderParameter
  • Gedcomx\Rs\Client\Options\Preconditions
  • Gedcomx\Rs\Client\Options\QueryParameter
  • Gedcomx\Rs\Client\PersonChildrenState
  • Gedcomx\Rs\Client\PersonParentsState
  • Gedcomx\Rs\Client\PersonSearchResultsState
  • Gedcomx\Rs\Client\PersonSpousesState
  • Gedcomx\Rs\Client\PersonsState
  • Gedcomx\Rs\Client\PersonState
  • Gedcomx\Rs\Client\PlaceDescriptionsState
  • Gedcomx\Rs\Client\PlaceDescriptionState
  • Gedcomx\Rs\Client\PlaceGroupState
  • Gedcomx\Rs\Client\PlaceSearchResultsState
  • Gedcomx\Rs\Client\RecordsState
  • Gedcomx\Rs\Client\RecordState
  • Gedcomx\Rs\Client\Rel
  • Gedcomx\Rs\Client\RelationshipsState
  • Gedcomx\Rs\Client\RelationshipState
  • Gedcomx\Rs\Client\SearchParameter
  • Gedcomx\Rs\Client\SourceDescriptionsState
  • Gedcomx\Rs\Client\SourceDescriptionState
  • Gedcomx\Rs\Client\StateFactory
  • Gedcomx\Rs\Client\Util\AncestryNode
  • Gedcomx\Rs\Client\Util\AncestryTree
  • Gedcomx\Rs\Client\Util\DataSource
  • Gedcomx\Rs\Client\Util\DescendancyNode
  • Gedcomx\Rs\Client\Util\DescendancyTree
  • Gedcomx\Rs\Client\Util\EmbeddedLinkLoader
  • Gedcomx\Rs\Client\Util\Embedding
  • Gedcomx\Rs\Client\Util\GedcomxBaseSearchQueryBuilder
  • Gedcomx\Rs\Client\Util\GedcomxPersonSearchQueryBuilder
  • Gedcomx\Rs\Client\Util\GedcomxPlaceSearchQueryBuilder
  • Gedcomx\Rs\Client\Util\HttpStatus
  • Gedcomx\Rs\Client\Util\RdfCollection
  • Gedcomx\Rs\Client\Util\RdfNode
  • Gedcomx\Rs\Client\Util\SearchParameter
  • Gedcomx\Rs\Client\VocabConstants
  • Gedcomx\Rs\Client\VocabElementListState
  • Gedcomx\Rs\Client\VocabElementState
  • Gedcomx\Rt\GedcomxLocalReferenceResolver
  • Gedcomx\Rt\GedcomxModelVisitorBase
  • Gedcomx\Search\ResultConfidence
  • Gedcomx\Source\CitationField
  • Gedcomx\Source\Coverage
  • Gedcomx\Source\SourceCitation
  • Gedcomx\Source\SourceDescription
  • Gedcomx\Source\SourceReference
  • Gedcomx\Types\ConfidenceLevel
  • Gedcomx\Types\DocumentType
  • Gedcomx\Types\EventRoleType
  • Gedcomx\Types\EventType
  • Gedcomx\Types\FactType
  • Gedcomx\Types\FieldType
  • Gedcomx\Types\FieldValueType
  • Gedcomx\Types\GenderType
  • Gedcomx\Types\IdentifierType
  • Gedcomx\Types\NamePartType
  • Gedcomx\Types\NameType
  • Gedcomx\Types\RecordType
  • Gedcomx\Types\RelationshipType
  • Gedcomx\Types\ResourceType
  • Gedcomx\Util\Collection
  • Gedcomx\Util\Duration
  • Gedcomx\Util\FormalDate
  • Gedcomx\Util\JsonMapper
  • Gedcomx\Util\SimpleDate
  • Gedcomx\Util\XmlMapper
  • Gedcomx\Vocab\VocabElement
  • Gedcomx\Vocab\VocabElementList

Interfaces

  • Gedcomx\Common\Attributable
  • Gedcomx\Common\HasNotes
  • Gedcomx\Conclusion\HasFacts
  • Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\PreferredRelationshipState
  • Gedcomx\Extensions\FamilySearch\Rt\FamilySearchPlatformModelVisitor
  • Gedcomx\GedcomxFile\GedcomxEntryDeserializer
  • Gedcomx\GedcomxFile\GedcomxEntrySerializer
  • Gedcomx\Links\SupportsLinks
  • Gedcomx\Records\HasFields
  • Gedcomx\Rs\Client\Options\StateTransitionOption
  • Gedcomx\Rs\Client\SupportsExtensionElements
  • Gedcomx\Rt\GedcomxModelVisitor
  • Gedcomx\Source\ReferencesSources
  • Gedcomx\Support\HasJsonKey

Exceptions

  • Gedcomx\GedcomxFile\GedcomxFileException
  • Gedcomx\Rs\Client\Exception\GedcomxApplicationException
  • Gedcomx\Rs\Client\Exception\GedcomxInvalidQueryParameter
  • Gedcomx\Rs\Client\Exception\NullValueException
  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 
<?php 

namespace Gedcomx\Extensions\FamilySearch\Rs\Client;

use Gedcomx\Extensions\FamilySearch\Rs\Client\Helpers\FamilySearchRequest;
use Gedcomx\Gedcomx;
use Gedcomx\Rs\Client\Exception\GedcomxInvalidQueryParameter;
use Gedcomx\Rs\Client\GedcomxApplicationState;
use Gedcomx\Rs\Client\GedcomxSearchQuery;
use Gedcomx\Rs\Client\Options\StateTransitionOption;
use Gedcomx\Rs\Client\Util\GedcomxPlaceSearchQueryBuilder;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;

/**
 * The FamilySearchPlaces is a collection of FamilySearch places and exposes management of those places.
 *
 * Class FamilySearchPlaces
 *
 * @package Gedcomx\Extensions\FamilySearch\Rs\Client
 */
class FamilySearchPlaces extends FamilySearchCollectionState
{
    /**
     * Clones the current state instance.
     *
     * @param \GuzzleHttp\Psr7\Request  $request
     * @param \GuzzleHttp\Psr7\Response $response
     *
     * @return \Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchPlaces
     */
    protected function reconstruct(Request $request, Response $response)
    {
        return new FamilySearchPlaces($this->client, $request, $response, $this->accessToken, $this->stateFactory);
    }

    /**
     * Read the list of place type groups
     *
     * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
     *
     * @return \Gedcomx\Rs\Client\VocabElementListState|null the list of place type groups
     */
    public function readPlaceTypeGroups(StateTransitionOption $option = null) {
        return $this->passOptionsTo('readPlaceElementList', array(Rel::PLACE_TYPE_GROUPS), func_get_args());
    }

    /**
     * Read the list of place types
     *
     * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
     *
     * @return \Gedcomx\Rs\Client\VocabElementListState the list of place types
     */
    public function readPlaceTypes(StateTransitionOption $option = null)
    {
        return $this->passOptionsTo('readPlaceElementList', array(Rel::PLACE_TYPES), func_get_args());
    }

    /**
     * Read the VocabElementList from the given path
     *
     * @param string                                           $path
     * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
     *
     * @return \Gedcomx\Rs\Client\VocabElementListState|null
     */
    protected function readPlaceElementList($path, StateTransitionOption $option = null)
    {
        $link = $this->getLink($path);
        if (null == $link || null == $link->getTemplate()) {
            return null;
        }

        $uri = array(
            $link->getTemplate(),
            array()
        );

        $request = $this->createAuthenticatedRequest('GET', $uri, ['Accept' => Gedcomx::LD_JSON_TYPE]);
        return $this->stateFactory->createState(
            'VocabElementListState',
            $this->client,
            $request,
            $this->passOptionsTo('invoke', array($request), func_get_args()),
            $this->accessToken
        );
    }

    /**
     * Read the place type group with the given id
     *
     * @param string                                           $id
     * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
     *
     * @return \Gedcomx\Rs\Client\VocabElementListState|null the place type group with the given id
     */
    public function readPlaceTypeGroupById($id, StateTransitionOption $option = null)
    {
        $link = $this->getLink(Rel::PLACE_TYPE_GROUP);
        if ($link == null || $link->getTemplate() == null) {
            return null;
        }

        $uri = array(
            $link->getTemplate(),
            array(
                'ptgid' => $id
            )
        );

        $request = $this->createAuthenticatedRequest('GET', $uri, ['Accept' => Gedcomx::LD_JSON_TYPE]);
        return $this->stateFactory->createState(
            'VocabElementListState',
            $this->client,
            $request,
            $this->passOptionsTo('invoke', array($request), func_get_args()),
            $this->accessToken
        );
    }

    /**
     * Read the place type with the given id
     *
     * @param string                                           $id
     * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
     *
     * @return \Gedcomx\Rs\Client\VocabElementState|null the place type group with the given id
     */
    public function readPlaceTypeById($id, StateTransitionOption $option = null)
    {
        $link = $this->getLink(Rel::PLACE_TYPE);
        if ($link == null || $link->getTemplate() == null) {
            return null;
        }

        $uri = array(
            $link->getTemplate(),
            array(
                "ptid" => $id
            )
        );

        $request = $this->createAuthenticatedRequest('GET', $uri, ['Accept' => Gedcomx::LD_JSON_TYPE]);
        return $this->stateFactory->createState(
            'VocabElementState',
            $this->client,
            $request,
            $this->passOptionsTo('invoke', array($request), func_get_args()),
            $this->accessToken
        );
    }

    /**
     * Return the PlaceGroup with the given id
     *
     * @param string                                           $id
     * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
     *
     * @return \Gedcomx\Rs\Client\PlaceGroupState|null
     */
    public function readPlaceGroupById($id, StateTransitionOption $option = null)
    {
        $link = $this->getLink(Rel::PLACE_GROUP);
        if ($link == null || $link->getTemplate() == null) {
            return null;
        }

        $uri = array(
            $link->getTemplate(),
            array(
                "pgid" => $id
            )
        );

        $request = $this->createAuthenticatedRequest('GET', $uri, FamilySearchRequest::getMediaTypes());
        return $this->stateFactory->createState(
            'PlaceGroupState',
            $this->client,
            $request,
            $this->passOptionsTo('invoke', array($request), func_get_args()),
            $this->accessToken
        );
    }

    /**
     * Searches for places based off the specified query.
     *
     * @param GedcomxSearchQuery|string $query
     * @param StateTransitionOption     $option,...
     *
     * @throws \Gedcomx\Rs\Client\Exception\GedcomxInvalidQueryParameter
     * @return \Gedcomx\Rs\Client\PlaceSearchResultsState|null
     */
    public function searchForPlaces($query, StateTransitionOption $option = null )
    {
        $searchLink = $this->getLink(Rel::PLACE_SEARCH);
        if ($searchLink === null || $searchLink->getTemplate() === null) {
            return null;
        }
        if ($query instanceof GedcomxPlaceSearchQueryBuilder) {
            $queryString = $query->build();
        } elseif (is_string($query)) {
            $queryString = $query;
        } else {
            throw new GedcomxInvalidQueryParameter($query);
        }

        $uri = array(
            $searchLink->getTemplate(),
            array(
                "q" => $queryString
            )
        );

        $request = $this->createAuthenticatedFeedRequest("GET", $uri, ['Accept' => Gedcomx::ATOM_JSON_MEDIA_TYPE]);
        return $this->stateFactory->createState(
            "PlaceSearchResultsState",
            $this->client,
            $request,
            $this->passOptionsTo('invoke', array($request), func_get_args()),
            $this->accessToken
        );
    }

}
gedcomx-php-client API documentation generated by ApiGen