Skip to content

Instantly share code, notes, and snippets.

@nhart
Created December 9, 2014 14:45
Show Gist options
  • Save nhart/04f39775a71ead03b51c to your computer and use it in GitHub Desktop.
Save nhart/04f39775a71ead03b51c to your computer and use it in GitHub Desktop.
convert facet pid to object label
public function renderText($results) {
module_load_include('inc', 'islandora', 'includes/utilities');
$facet_field = $this->facet_field;
$islandora_solr_query = self::$islandoraSolrQuery;
$soft_limit = self::$soft_limit;
$buckets = array();
foreach ($results as $key => $values) {
$bucket = $values['bucket'];
if (variable_get('islandora_solr_facet_replace_pid', FALSE) && islandora_is_valid_pid($bucket)) {
if ($object = islandora_object_load($bucket)) {
if (islandora_object_access(ISLANDORA_VIEW_OBJECTS, $object)) {
$bucket = $object->label;
}
}
}
$filter = $values['filter'];
$count = $values['count'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment