ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ilNotificationUserIterator.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Notifications
;
22
23
use
ilDBInterface
;
24
use
ilDBStatement
;
25
use
Iterator
;
26
use
ilDBConstants
;
27
32
class
ilNotificationUserIterator
implements
Iterator
33
{
34
private
ilDBStatement
$rset
;
35
private
readonly
ilDBInterface
$db
;
37
private
?array
$data
=
null
;
38
42
public
function
__construct
(
private
readonly
string
$module,
private
readonly array $userids = [])
43
{
44
global
$DIC
;
45
46
$this->db = $DIC->database();
47
$this->
rewind
();
48
}
49
50
public
function
__destruct
()
51
{
52
$this->db->free($this->rset);
53
}
54
58
public
function
current
(): array
59
{
60
return
$this->data
;
61
}
62
63
public
function
key
():
int
64
{
65
return
(
int
) $this->data[
'usr_id'
];
66
}
67
68
public
function
next
(): void
69
{
70
}
71
72
public
function
rewind
(): void
73
{
74
$query =
'SELECT usr_id, module, channel FROM '
.
ilNotificationSetupHelper::$tbl_userconfig
.
' WHERE module = %s AND '
. $this->db->in(
75
'usr_id'
,
76
$this->userids,
77
false
,
78
ilDBConstants::T_INTEGER
79
);
80
$types = [
ilDBConstants::T_TEXT
];
81
$values = [$this->module];
82
$this->rset = $this->db->queryF($query, $types, $values);
83
}
84
85
public
function
valid
(): bool
86
{
87
$this->data = $this->db->fetchAssoc($this->rset);
88
89
return
is_array($this->data);
90
}
91
}
ILIAS\Notifications\ilNotificationUserIterator\$db
readonly ilDBInterface $db
Definition:
ilNotificationUserIterator.php:35
ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userconfig
static string $tbl_userconfig
Definition:
ilNotificationSetupHelper.php:31
ILIAS\Notifications\ilNotificationUserIterator\__construct
__construct(private readonly string $module, private readonly array $userids=[])
Definition:
ilNotificationUserIterator.php:42
ILIAS\Notifications\ilNotificationUserIterator
Definition:
ilNotificationUserIterator.php:32
ILIAS\Notifications\ilNotificationUserIterator\next
next()
Definition:
ilNotificationUserIterator.php:68
ILIAS\Notifications\ilNotificationUserIterator\$rset
ilDBStatement $rset
Definition:
ilNotificationUserIterator.php:34
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ilDBConstants\T_TEXT
const T_TEXT
Definition:
class.ilDBConstants.php:56
ilDBConstants
ILIAS\Notifications\ilNotificationUserIterator\rewind
rewind()
Definition:
ilNotificationUserIterator.php:72
ilDBStatement
$DIC
global $DIC
Definition:
shib_login.php:26
ilDBInterface
ILIAS\Notifications\ilNotificationUserIterator\valid
valid()
Definition:
ilNotificationUserIterator.php:85
ILIAS\Notifications\ilNotificationUserIterator\key
key()
Definition:
ilNotificationUserIterator.php:63
ILIAS\Notifications
Iterator
ilDBConstants\T_INTEGER
const T_INTEGER
Definition:
class.ilDBConstants.php:55
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ILIAS\Notifications\ilNotificationUserIterator\__destruct
__destruct()
Definition:
ilNotificationUserIterator.php:50
ILIAS\Notifications\ilNotificationUserIterator\current
current()
Definition:
ilNotificationUserIterator.php:58
ILIAS\Notifications\ilNotificationUserIterator\$data
array $data
Definition:
ilNotificationUserIterator.php:37
components
ILIAS
Notifications
classes
ilNotificationUserIterator.php
Generated on Sun Aug 31 2025 23:03:29 for ILIAS by
1.8.13 (using
Doxyfile
)