You are here

protected function PubSubHubbub::findRelation in Feeds 8.3

Finds a hub from a fetcher result.

Parameters

\Drupal\feeds\Result\FetcherResultInterface $fetcher_result: The fetcher result.

string $relation: The type of relation to find.

Return value

string|null The hub URL or null if one wasn't found.

1 call to PubSubHubbub::findRelation()
PubSubHubbub::onPostFetch in src/EventSubscriber/PubSubHubbub.php
Subscribes to a feed.

File

src/EventSubscriber/PubSubHubbub.php, line 286

Class

PubSubHubbub
Event listener for PubSubHubbub subscriptions.

Namespace

Drupal\feeds\EventSubscriber

Code

protected function findRelation(FetcherResultInterface $fetcher_result, $relation) {
  if ($fetcher_result instanceof HttpFetcherResultInterface) {
    if ($rel = HttpHelpers::findLinkHeader($fetcher_result
      ->getHeaders(), $relation)) {
      return $rel;
    }
  }
  return HttpHelpers::findRelationFromXml($fetcher_result
    ->getRaw(), $relation);
}