Example #1
0
 /**
  * @param TaxonomyTermInterface $term
  * @param string                $filter
  * @return int
  * @throws \Taxonomy\Exception\RuntimeException
  */
 public function countAssociations(TaxonomyTermInterface $term, $filter)
 {
     if ($filter === 'NotTrashed') {
         $filter = new NotTrashedCollectionFilter();
         return $term->countAssociations(null, $filter);
     } else {
         throw new Exception\RuntimeException();
     }
 }