XmlSearchengine.php 420 Bytes
Newer Older
Karl Hasselbring's avatar
Karl Hasselbring committed
1
2
3
4
<?php

namespace App\Models;

Dominik Hebeler's avatar
Dominik Hebeler committed
5
6
use Log;

Karl Hasselbring's avatar
Karl Hasselbring committed
7
8
9
10
11
abstract class XmlSearchengine extends Searchengine
{
    public function loadresults($results)
    {
        try {
Dominik Hebeler's avatar
Dominik Hebeler committed
12
            $resultsXml = \simplexml_load_string($results);
Karl Hasselbring's avatar
Karl Hasselbring committed
13
14
            $this->loadXmlResults($resultsXml);
        } catch (\Exception $e) {
15
            Log::error($e->getMessage());
Karl Hasselbring's avatar
Karl Hasselbring committed
16
17
18
        }
    }

19
    abstract protected function loadXmlResults($resultsXml);
Karl Hasselbring's avatar
Karl Hasselbring committed
20
}