Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
Link | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
readSearchResultList | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | /** |
4 | * @package ClientDldb |
5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
6 | **/ |
7 | |
8 | namespace BO\Zmsdldb\MySQL; |
9 | |
10 | use BO\Zmsdldb\MySQL\Collection\Links as Collection; |
11 | use BO\Zmsdldb\Elastic\Link as Base; |
12 | |
13 | /** |
14 | */ |
15 | class Link extends Base |
16 | { |
17 | public function readSearchResultList($query) |
18 | { |
19 | try { |
20 | #$query = '+' . implode(' +', explode(' ', $query)); |
21 | $sqlArgs = [$this->locale, $query]; |
22 | $sql = "SELECT tl.data_json |
23 | FROM topic_links AS tl |
24 | WHERE |
25 | tl.locale = ? AND MATCH (tl.search) AGAINST (? IN BOOLEAN MODE) |
26 | "; |
27 | |
28 | $linklist = new Collection(); |
29 | |
30 | $stm = $this->access()->prepare($sql); |
31 | $stm->execute($sqlArgs); |
32 | $stm->fetchAll(\PDO::FETCH_FUNC, function ($data_json) use ($linklist) { |
33 | $link = new \BO\Zmsdldb\MySQL\Entity\Link(); |
34 | $link->offsetSet('data_json', $data_json); |
35 | $linklist[$link['link']] = $link; |
36 | }); |
37 | |
38 | return $linklist; |
39 | } catch (\Exception $e) { |
40 | throw $e; |
41 | } |
42 | } |
43 | } |