ILIAS  release_8 Revision v8.24
ilCtrlArrayIterator Class Reference

Class ilCtrlArrayIterator. More...

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

Public Member Functions

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

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.

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

References $data.

Member Function Documentation

◆ current()

ilCtrlArrayIterator::current ( )

@inheritDoc

Implements ilCtrlIteratorInterface.

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

32 : ?string
33 {
34 if ($this->valid()) {
35 return current($this->data);
36 }
37
38 return null;
39 }

References current(), and valid().

Referenced by current(), and valid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key()

ilCtrlArrayIterator::key ( )

@inheritDoc

Implements ilCtrlIteratorInterface.

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

52 : ?string
53 {
54 if ($this->valid()) {
55 return key($this->data);
56 }
57
58 return null;
59 }

References key(), and valid().

Referenced by key(), and valid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ next()

ilCtrlArrayIterator::next ( )

@inheritDoc

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

44 : void
45 {
46 next($this->data);
47 }

References next().

Referenced by next(), and valid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rewind()

ilCtrlArrayIterator::rewind ( )

@inheritDoc

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

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

◆ valid()

ilCtrlArrayIterator::valid ( )

@inheritDoc

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

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

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

Referenced by current(), key(), and valid().

+ 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: