ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Notifications\ilNotificationUserIterator Class Reference
+ Inheritance diagram for ILIAS\Notifications\ilNotificationUserIterator:
+ Collaboration diagram for ILIAS\Notifications\ilNotificationUserIterator:

Public Member Functions

 __construct (private readonly string $module, private readonly array $userids=[])
 
 __destruct ()
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Private Attributes

ilDBStatement $rset
 
readonly ilDBInterface $db
 
array $data = null
 

Detailed Description

Author
Jan Posselt jposs.nosp@m.elt@.nosp@m.datab.nosp@m.ay.d.nosp@m.e <int, array<string, mixed>>

Definition at line 32 of file ilNotificationUserIterator.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Notifications\ilNotificationUserIterator::__construct ( private readonly string  $module,
private readonly array  $userids = [] 
)
Parameters
list<int>$userids

Definition at line 42 of file ilNotificationUserIterator.php.

43 {
44 global $DIC;
45
46 $this->db = $DIC->database();
47 $this->rewind();
48 }
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\Notifications\ilNotificationUserIterator\rewind().

+ Here is the call graph for this function:

◆ __destruct()

ILIAS\Notifications\ilNotificationUserIterator::__destruct ( )

Definition at line 50 of file ilNotificationUserIterator.php.

51 {
52 $this->db->free($this->rset);
53 }

Member Function Documentation

◆ current()

ILIAS\Notifications\ilNotificationUserIterator::current ( )
Returns
array<string, mixed>

Definition at line 58 of file ilNotificationUserIterator.php.

References ILIAS\Notifications\ilNotificationUserIterator\$data.

◆ key()

ILIAS\Notifications\ilNotificationUserIterator::key ( )

Definition at line 63 of file ilNotificationUserIterator.php.

63 : int
64 {
65 return (int) $this->data['usr_id'];
66 }

◆ next()

ILIAS\Notifications\ilNotificationUserIterator::next ( )

Definition at line 68 of file ilNotificationUserIterator.php.

68 : void
69 {
70 }

◆ rewind()

ILIAS\Notifications\ilNotificationUserIterator::rewind ( )

Definition at line 72 of file ilNotificationUserIterator.php.

72 : 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,
79 );
80 $types = [ilDBConstants::T_TEXT];
81 $values = [$this->module];
82 $this->rset = $this->db->queryF($query, $types, $values);
83 }

References ILIAS\Notifications\ilNotificationSetupHelper\$tbl_userconfig, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Notifications\ilNotificationUserIterator\__construct().

+ Here is the caller graph for this function:

◆ valid()

ILIAS\Notifications\ilNotificationUserIterator::valid ( )

Definition at line 85 of file ilNotificationUserIterator.php.

85 : bool
86 {
87 $this->data = $this->db->fetchAssoc($this->rset);
88
89 return is_array($this->data);
90 }

Field Documentation

◆ $data

array ILIAS\Notifications\ilNotificationUserIterator::$data = null
private

◆ $db

readonly ilDBInterface ILIAS\Notifications\ilNotificationUserIterator::$db
private

Definition at line 35 of file ilNotificationUserIterator.php.

◆ $rset

ilDBStatement ILIAS\Notifications\ilNotificationUserIterator::$rset
private

Definition at line 34 of file ilNotificationUserIterator.php.


The documentation for this class was generated from the following file: