ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilUserSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
30{
31 private bool $active_check = false;
32 private bool $inactive_check = false;
33
34 public function enableActiveCheck(bool $a_enabled): void
35 {
36 $this->active_check = $a_enabled;
37 }
38
39 public function enableInactiveCheck(bool $a_enabled): void
40 {
41 $this->inactive_check = $a_enabled;
42 }
43
44 public function performSearch(): ilSearchResult
45 {
46 $where = $this->__createWhereCondition();
47 $locate = $this->__createLocateString();
48
49 $query = "SELECT usr_id " .
50 $locate .
51 "FROM usr_data " .
52 $where;
53 if ($this->active_check) {
54 $query .= 'AND active = 1 ';
55 } elseif ($this->inactive_check) {
56 $query .= 'AND active = 0 ';
57 }
58
59
60 $res = $this->db->query($query);
61 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
62 $this->search_result->addEntry((int) $row->usr_id, 'usr', $this->__prepareFound($row));
63 }
65 }
66}
ilSearchResult $search_result
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
enableInactiveCheck(bool $a_enabled)
enableActiveCheck(bool $a_enabled)
$res
Definition: ltiservices.php:69