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

More static cleanup.

parent 03e9fc93
No related merge requests found
...@@ -52,7 +52,7 @@ class Results extends BaseResults ...@@ -52,7 +52,7 @@ class Results extends BaseResults
* *
* @return SummonConnection * @return SummonConnection
*/ */
public static function getSummonConnection() public function getSummonConnection()
{ {
static $conn = false; static $conn = false;
if (!$conn) { if (!$conn) {
...@@ -78,7 +78,7 @@ class Results extends BaseResults ...@@ -78,7 +78,7 @@ class Results extends BaseResults
$finalSort = ($sort == 'relevance') ? null : $sort; $finalSort = ($sort == 'relevance') ? null : $sort;
// Perform the actual search // Perform the actual search
$summon = self::getSummonConnection(); $summon = $this->getSummonConnection();
$query = new SummonQuery( $query = new SummonQuery(
$summon->buildQuery($this->getParams()->getSearchTerms()), $summon->buildQuery($this->getParams()->getSearchTerms()),
array( array(
...@@ -138,7 +138,7 @@ class Results extends BaseResults ...@@ -138,7 +138,7 @@ class Results extends BaseResults
*/ */
public function getRecord($id) public function getRecord($id)
{ {
$summon = static::getSummonConnection(); $summon = $this->getSummonConnection();
$record = $summon->getRecord($id); $record = $summon->getRecord($id);
if (empty($record) || !isset($record['documents'][0])) { if (empty($record) || !isset($record['documents'][0])) {
throw new RecordMissingException( throw new RecordMissingException(
......
...@@ -50,7 +50,7 @@ class Results extends BaseResults ...@@ -50,7 +50,7 @@ class Results extends BaseResults
* *
* @return WorldCatConnection * @return WorldCatConnection
*/ */
public static function getWorldCatConnection() public function getWorldCatConnection()
{ {
static $wc = false; static $wc = false;
if (!$wc) { if (!$wc) {
...@@ -69,7 +69,7 @@ class Results extends BaseResults ...@@ -69,7 +69,7 @@ class Results extends BaseResults
{ {
// Collect the search parameters: // Collect the search parameters:
$config = ConfigReader::getConfig(); $config = ConfigReader::getConfig();
$wc = static::getWorldCatConnection(); $wc = $this->getWorldCatConnection();
$overrideQuery = $this->getParams()->getOverrideQuery(); $overrideQuery = $this->getParams()->getOverrideQuery();
$query = empty($overrideQuery) $query = empty($overrideQuery)
? $wc->buildQuery($this->getParams()->getSearchTerms()) : $overrideQuery; ? $wc->buildQuery($this->getParams()->getSearchTerms()) : $overrideQuery;
...@@ -107,7 +107,7 @@ class Results extends BaseResults ...@@ -107,7 +107,7 @@ class Results extends BaseResults
*/ */
public function getRecord($id) public function getRecord($id)
{ {
$wc = static::getWorldCatConnection(); $wc = $this->getWorldCatConnection();
$record = $wc->getRecord($id); $record = $wc->getRecord($id);
if (empty($record)) { if (empty($record)) {
throw new RecordMissingException( throw new RecordMissingException(
......
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