ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCtrlArrayIterator Class Reference

Class ilCtrlArrayIterator. More...

+ Inheritance diagram for ilCtrlArrayIterator:
+ Collaboration diagram for ilCtrlArrayIterator:

Public Member Functions

 __construct (array $data)
 ilCtrlArrayIterator Constructor More...
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 

Private Attributes

array $data
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCtrlArrayIterator::__construct ( array  $data)

ilCtrlArrayIterator Constructor

Parameters
string[]

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

References $data.

39  {
40  $this->data = $data;
41  }

Member Function Documentation

◆ current()

ilCtrlArrayIterator::current ( )

Implements ilCtrlIteratorInterface.

Definition at line 46 of file class.ilCtrlArrayIterator.php.

References null, and valid().

Referenced by valid().

46  : ?string
47  {
48  if ($this->valid()) {
49  return current($this->data);
50  }
51 
52  return null;
53  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key()

ilCtrlArrayIterator::key ( )

Implements ilCtrlIteratorInterface.

Definition at line 66 of file class.ilCtrlArrayIterator.php.

References null, and valid().

Referenced by valid().

66  : ?string
67  {
68  if ($this->valid()) {
69  return key($this->data);
70  }
71 
72  return null;
73  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next()

ilCtrlArrayIterator::next ( )

Definition at line 58 of file class.ilCtrlArrayIterator.php.

Referenced by valid().

58  : void
59  {
60  next($this->data);
61  }
+ Here is the caller graph for this function:

◆ rewind()

ilCtrlArrayIterator::rewind ( )

Definition at line 98 of file class.ilCtrlArrayIterator.php.

98  : void
99  {
100  reset($this->data);
101  }

◆ valid()

ilCtrlArrayIterator::valid ( )

Definition at line 78 of file class.ilCtrlArrayIterator.php.

References current(), key(), next(), and null.

Referenced by current(), and key().

78  : bool
79  {
80  $value = current($this->data);
81  $key = key($this->data);
82 
83  if (null === $key) {
84  return false;
85  }
86 
87  if (!is_string($value) || !is_string($key)) {
88  $this->next();
89  return $this->valid();
90  }
91 
92  return true;
93  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $data

array ilCtrlArrayIterator::$data
private

Definition at line 31 of file class.ilCtrlArrayIterator.php.

Referenced by __construct().


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