Skip to content
Snippets Groups Projects
Commit 92a867f8 authored by Demian Katz's avatar Demian Katz
Browse files

Simplified logic.

parent 4a977c84
No related merge requests found
......@@ -152,22 +152,21 @@ class Pazpar2 extends SolrDefault
*/
public function getProviders()
{
if ($this->pz2fields['location']) {
if (isset($this->pz2fields['location']['_attr_'])) {
return array($this->pz2fields['location']['_attr_']['name']);
} else {
$providers = array();
foreach ($this->pz2fields['location'] as $i=>$location) {
if ( isset($location['_attr_']['name'])
&& !in_array($location['_attr_']['name'], $providers)
) {
$providers[] = $location['_attr_']['name'];
}
}
return $providers;
if (!$this->pz2fields['location']) {
return array();
}
if (isset($this->pz2fields['location']['_attr_'])) {
return array($this->pz2fields['location']['_attr_']['name']);
}
$providers = array();
foreach ($this->pz2fields['location'] as $location) {
if (isset($location['_attr_']['name'])
&& !in_array($location['_attr_']['name'], $providers)
) {
$providers[] = $location['_attr_']['name'];
}
}
return array();
return $providers;
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment