ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
ContextStack.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
namespace
ILIAS\GlobalScreen\ScreenContext\Stack
;
21
22
use
ILIAS\GlobalScreen\ScreenContext\ScreenContext
;
23
use
LogicException
;
24
29
class
ContextStack
30
{
34
protected
$stack
= [];
35
39
public
function
push
(
ScreenContext
$context
) : void
40
{
41
if
(in_array($context, $this->stack)) {
42
throw
new
LogicException
(
"A context can only be claimed once"
);
43
}
44
$this->stack[] =
$context
;
45
}
46
50
public
function
getLast
() :
ScreenContext
51
{
52
return
end($this->stack);
53
}
54
58
public
function
getStack
() : array
59
{
60
return
$this->stack
;
61
}
62
66
public
function
getStackAsArray
() : array
67
{
68
$return = [];
69
foreach
($this->stack as $item) {
70
$return[] = $item->getUniqueContextIdentifier();
71
}
72
73
return
$return;
74
}
75
}
LogicException
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\getStackAsArray
getStackAsArray()
Definition:
ContextStack.php:66
$context
$context
Definition:
webdav.php:26
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack
Class ContextStack.
Definition:
ContextStack.php:29
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\$stack
$stack
Definition:
ContextStack.php:34
ScreenContext
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\getStack
getStack()
Definition:
ContextStack.php:58
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\push
push(ScreenContext $context)
Definition:
ContextStack.php:39
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\getLast
getLast()
Definition:
ContextStack.php:50
ILIAS\GlobalScreen\ScreenContext\Stack
Definition:
CalledContexts.php:21
ILIAS\GlobalScreen\ScreenContext\ScreenContext
Interface ScreenContext.
Definition:
ScreenContext.php:29
src
GlobalScreen
ScreenContext
Stack
ContextStack.php
Generated on Tue Sep 2 2025 21:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)