You are here

public function MixitupFunc::populateFilters in MixItUp Views 8.2

Same name and namespace in other branches
  1. 8 src/MixitupFunc.php \Drupal\mixitup_views\MixitupFunc::populateFilters()

Populates structured array of used taxonomy terms.

Parameters

int $tid: Taxonomy id.

int $nid: Node id.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to MixitupFunc::populateFilters()
MixitupFunc::getRowClasses in src/MixitupFunc.php
Get classes string for node.

File

src/MixitupFunc.php, line 134

Class

MixitupFunc
Performs assistance functionality.

Namespace

Drupal\mixitup_views

Code

public function populateFilters($tid, $nid) {
  $term = $this->entityTypeManager
    ->getStorage('taxonomy_term')
    ->load($tid);

  /* @var \Drupal\taxonomy\Entity\Term $term */
  if (!empty($term)) {
    $vid = $term
      ->bundle();
    self::$populatedFilters[$vid]['.tid_' . $tid] = $term
      ->getName();
    $this
      ->populateNodeFilters($nid, $tid);
  }
}