You are here

protected function Vocabulary::determineCountVisibility in Sitemap 2.0.x

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

Determine whether the usage count for a term should be displayed.

Parameters

\stdClass $term:

Return value

boolean

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

File

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

Class

Vocabulary
Provides a sitemap for an taxonomy vocabulary.

Namespace

Drupal\sitemap\Plugin\Sitemap

Code

protected function determineCountVisibility($term) {
  if ($this->settings['show_count']) {
    if ($threshold = $this->settings['term_count_threshold']) {
      if ($term->count >= $threshold) {
        return TRUE;
      }
    }
    else {
      return TRUE;
    }
  }
  return FALSE;
}