ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
class.ilCtrlArrayIterator.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
26
class
ilCtrlArrayIterator
implements
ilCtrlIteratorInterface
27
{
31
private
array
$data
;
32
38
public
function
__construct
(array
$data
)
39
{
40
$this->data =
$data
;
41
}
42
46
public
function
current
(): ?string
47
{
48
if
($this->
valid
()) {
49
return
current
($this->data);
50
}
51
52
return
null
;
53
}
54
58
public
function
next
(): void
59
{
60
next
($this->data);
61
}
62
66
public
function
key
(): ?string
67
{
68
if
($this->
valid
()) {
69
return
key
($this->data);
70
}
71
72
return
null
;
73
}
74
78
public
function
valid
(): 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
}
94
98
public
function
rewind
(): void
99
{
100
reset($this->data);
101
}
102
}
ilCtrlArrayIterator
Class ilCtrlArrayIterator.
Definition:
class.ilCtrlArrayIterator.php:27
ilCtrlArrayIterator\$data
array $data
Definition:
class.ilCtrlArrayIterator.php:31
ilCtrlArrayIterator\__construct
__construct(array $data)
ilCtrlArrayIterator Constructor
Definition:
class.ilCtrlArrayIterator.php:38
ilCtrlArrayIterator\next
next()
@inheritDoc
Definition:
class.ilCtrlArrayIterator.php:58
ilCtrlArrayIterator\key
key()
@inheritDoc
Definition:
class.ilCtrlArrayIterator.php:66
ilCtrlArrayIterator\rewind
rewind()
@inheritDoc
Definition:
class.ilCtrlArrayIterator.php:98
ilCtrlArrayIterator\valid
valid()
@inheritDoc
Definition:
class.ilCtrlArrayIterator.php:78
ilCtrlArrayIterator\current
current()
@inheritDoc
Definition:
class.ilCtrlArrayIterator.php:46
ilCtrlIteratorInterface
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
interface.ilCtrlIteratorInterface.php:34
components
ILIAS
UICore
classes
Iterator
class.ilCtrlArrayIterator.php
Generated on Sat Oct 18 2025 23:04:57 for ILIAS by
1.9.4 (using
Doxyfile
)