You are here

protected function SearchApiViewsHandlerFilterTaxonomyTerm::ids_to_strings in Search API 7

Transforms an array of entity IDs into a comma-separated list of labels.

Parameters

array $ids: The entity IDs to transform.

Return value

string A string containing the labels corresponding to the IDs, separated by commas.

Overrides SearchApiViewsHandlerFilterEntity::ids_to_strings

File

contrib/search_api_views/includes/handler_filter_taxonomy_term.inc, line 323
Contains SearchApiViewsHandlerFilterTaxonomyTerm.

Class

SearchApiViewsHandlerFilterTaxonomyTerm
Views filter handler class for taxonomy term entities.

Code

protected function ids_to_strings(array $ids) {
  $ids = array_filter($ids);
  if (!$ids) {
    return '';
  }
  return implode(', ', db_select('taxonomy_term_data', 'td')
    ->fields('td', array(
    'name',
  ))
    ->condition('td.tid', $ids)
    ->execute()
    ->fetchCol());
}