public static function resolveByRef(ResourceReference $ref, Gedcomx $document)
 {
     if ($ref->getResource() == null) {
         return null;
     }
     return GedcomxLocalReferenceResolver::resolveByString($ref->getResource(), $document);
 }
Exemplo n.º 2
0
 /**
  * Check a resource reference to see if its URI is the same as this person.
  *
  * @param ResourceReference|null $ref
  *
  * @return bool
  */
 protected function refersToMe(ResourceReference $ref = null)
 {
     return $ref != null && $ref->getResource() != null && $ref->getResource() == "#" . $this->getLocalSelfId();
 }
 /**
  * Reads the contributor for the specified resource reference.
  *
  * @param \Gedcomx\Common\ResourceReference                $contributor
  * @param \Gedcomx\Rs\Client\Options\StateTransitionOption $option,...
  *
  * @return \Gedcomx\Rs\Client\AgentState|null
  */
 public function readReferenceContributor(ResourceReference $contributor, StateTransitionOption $option = null)
 {
     if ($contributor == null || $contributor->getResource() == null) {
         return null;
     }
     $request = $this->createAuthenticatedGedcomxRequest('GET', $contributor->getResource());
     return $this->stateFactory->createState('AgentState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken);
 }