ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLikeUserSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
31{
32 public function __createWhereCondition(): string
33 {
34 $fields = $this->getFields();
35 $field = $fields[0] . ' ';
36
37 $and = " WHERE ( ";
38
39 $counter = 0;
40 foreach ($this->query_parser->getQuotedWords() as $word) {
41 if ($counter++) {
42 $and .= " OR ";
43 }
44
45 if (strpos($word, '^') === 0) {
46 $and .= $this->db->like($field, 'text', substr($word, 1) . '%');
47 } else {
48 $and .= $this->db->like($field, 'text', '%' . $word . '%');
49 }
50 }
51 return $and . ") ";
52 }
53}
$counter