ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 24 of file class.ilCtrlArrayIterator.php.

References $data.

25  {
26  $this->data = $data;
27  }

Member Function Documentation

◆ current()

ilCtrlArrayIterator::current ( )

Implements ilCtrlIteratorInterface.

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

References valid().

Referenced by valid().

32  : ?string
33  {
34  if ($this->valid()) {
35  return current($this->data);
36  }
37 
38  return null;
39  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key()

ilCtrlArrayIterator::key ( )

Implements ilCtrlIteratorInterface.

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

References valid().

Referenced by valid().

52  : ?string
53  {
54  if ($this->valid()) {
55  return key($this->data);
56  }
57 
58  return null;
59  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next()

ilCtrlArrayIterator::next ( )

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

Referenced by valid().

44  : void
45  {
46  next($this->data);
47  }
+ Here is the caller graph for this function:

◆ rewind()

ilCtrlArrayIterator::rewind ( )

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

84  : void
85  {
86  reset($this->data);
87  }

◆ valid()

ilCtrlArrayIterator::valid ( )

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

References ILIAS\LTI\ToolProvider\$key, current(), key(), and next().

Referenced by current(), and key().

64  : bool
65  {
66  $value = current($this->data);
67  $key = key($this->data);
68 
69  if (null === $key) {
70  return false;
71  }
72 
73  if (!is_string($value) || !is_string($key)) {
74  $this->next();
75  return $this->valid();
76  }
77 
78  return true;
79  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ 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 17 of file class.ilCtrlArrayIterator.php.

Referenced by __construct().


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