You are here

protected function Vocabulary::buildFeedLink in Sitemap 8.2

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Sitemap/Vocabulary.php \Drupal\sitemap\Plugin\Sitemap\Vocabulary::buildFeedLink()

Builds the taxonomy term feed link.

Parameters

\stdClass $term: The term object returned by TermStorage::loadTree()

Return value

string|void

1 call to Vocabulary::buildFeedLink()
Vocabulary::buildSitemapTerm in src/Plugin/Sitemap/Vocabulary.php
Builds a taxonomy term item.

File

src/Plugin/Sitemap/Vocabulary.php, line 337

Class

Vocabulary
Provides a sitemap for an taxonomy vocabulary.

Namespace

Drupal\sitemap\Plugin\Sitemap

Code

protected function buildFeedLink($term) {
  $rssDepth = $this->settings['rss_depth'];
  if ($rssDepth && isset($term->treeDepth) && $rssDepth >= $term->treeDepth) {

    // Route validation will be provided on form save and config update,
    // rather than every time a link is created.
    if (isset($this->settings['rss_link'])) {
      return $this
        ->buildLink($this->settings['rss_link'], $term->tid);
    }
  }
}