ILIAS  release_4-4 Revision
ilNotificationUserIterator Class Reference

wrapper for iterating a list of user settings by providing the user ids More...

+ Inheritance diagram for ilNotificationUserIterator:
+ Collaboration diagram for ilNotificationUserIterator:

Public Member Functions

 __construct ($module, array $userids=array())
 
 __destruct ()
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 

Private Attributes

 $userids
 
 $rset
 
 $data
 
 $module
 

Detailed Description

wrapper for iterating a list of user settings by providing the user ids

Definition at line 8 of file class.ilNotificationUserIterator.php.

Constructor & Destructor Documentation

◆ __construct()

ilNotificationUserIterator::__construct (   $module,
array  $userids = array() 
)

Definition at line 15 of file class.ilNotificationUserIterator.php.

References $module, $userids, and rewind().

15  {
16  global $ilDB;
17 
18  $this->db = $ilDB;
19  $this->userids = $userids;
20 
21  $this->module = $module;
22 
23  $this->rewind();
24  }
+ Here is the call graph for this function:

◆ __destruct()

ilNotificationUserIterator::__destruct ( )

Definition at line 26 of file class.ilNotificationUserIterator.php.

26  {
27  $this->db->free($this->rset);
28  }

Member Function Documentation

◆ current()

ilNotificationUserIterator::current ( )

Definition at line 30 of file class.ilNotificationUserIterator.php.

References $data.

◆ key()

ilNotificationUserIterator::key ( )

Definition at line 34 of file class.ilNotificationUserIterator.php.

34  {
35  return (int)$this->data['usr_id'];
36  }

◆ next()

ilNotificationUserIterator::next ( )

Definition at line 38 of file class.ilNotificationUserIterator.php.

38  {
39  //$this->data = $this->db->fetchAssoc($this->rset);
40  }

◆ rewind()

ilNotificationUserIterator::rewind ( )

Definition at line 42 of file class.ilNotificationUserIterator.php.

References $query, and ilNotificationSetupHelper\$tbl_userconfig.

Referenced by __construct().

42  {
43  $query = 'SELECT usr_id, module, channel FROM ' . ilNotificationSetupHelper::$tbl_userconfig . ' WHERE module=%s AND ' . $this->db->in('usr_id', $this->userids, false, 'integer');
44  $types = array('text');
45  $values = array($this->module);
46  $this->rset = $this->db->queryF($query, $types, $values);
47  }
+ Here is the caller graph for this function:

◆ valid()

ilNotificationUserIterator::valid ( )

Definition at line 49 of file class.ilNotificationUserIterator.php.

49  {
50  $this->data = $this->db->fetchAssoc($this->rset);
51  return is_array($this->data);
52  }

Field Documentation

◆ $data

ilNotificationUserIterator::$data
private

Definition at line 12 of file class.ilNotificationUserIterator.php.

Referenced by current().

◆ $module

ilNotificationUserIterator::$module
private

Definition at line 13 of file class.ilNotificationUserIterator.php.

Referenced by __construct().

◆ $rset

ilNotificationUserIterator::$rset
private

Definition at line 11 of file class.ilNotificationUserIterator.php.

◆ $userids

ilNotificationUserIterator::$userids
private

Definition at line 10 of file class.ilNotificationUserIterator.php.

Referenced by __construct().


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