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
<?php
namespace Gedcomx\Extensions\FamilySearch\Rs\Client;
use Gedcomx\Rs\Client\PlaceDescriptionState;
use GuzzleHttp\Psr7\Request;
class FamilySearchPlaceDescriptionState extends PlaceDescriptionState
{
public function readPlace(StateTransitionOption $option = null)
{
$link = $this->getLink(Rel::PLACE);
$link = $link == null ? $this->getLink(Rel::SELF) : $link;
if ($link == null || $link->getHref() == null) {
return null;
}
$request = $this->createAuthenticatedGedcomxRequest('GET', $link->getHref());
return $this->stateFactory->createState(
'PlaceState',
$this->client,
$request,
$this->passOptionsTo('invoke', array($request), func_get_args()),
$this->accessToken);
}
}