ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLikeForumSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
31{
32 public function __createPostAndCondition(): string
33 {
34 /*
35 $concat = " CONCAT(";
36 $concat .= 'pos_message,pos_subject';
37 $concat .= ") ";
38 */
39 $concat = $this->db->concat(
40 array(
41 array('pos_subject','text'),
42 array('pos_message','text'))
43 );
44
45 $and = " AND ( ";
46 $counter = 0;
47 foreach ($this->query_parser->getQuotedWords() as $word) {
48 if ($counter++) {
49 $and .= " OR";
50 }
51 #$and .= $concat;
52 #$and .= ("LIKE ('%".$word."%')");
53 $and .= $this->db->like($concat, 'clob', '%' . $word . '%');
54 }
55 return $and . ") ";
56 }
57
58 public function __createTopicAndCondition(): string
59 {
60 $field = 'thr_subject ';
61 $and = " AND( ";
62
63 $counter = 0;
64 foreach ($this->query_parser->getQuotedWords() as $word) {
65 if ($counter++) {
66 $and .= " OR ";
67 }
68 #$and .= $field;
69 #$and .= ("LIKE ('%".$word."%')");
70 $and .= $this->db->like($field, 'text', '%' . $word . '%');
71 }
72 return $and . " ) ";
73 }
74}
$counter