ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
LinkList.php
Go to the documentation of this file.
1
<?
php
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
;
2
3
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
;
4
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
5
use
InvalidArgumentException
;
6
12
class
LinkList
extends
AbstractChildItem
implements
hasTitle
13
{
14
18
protected
$title
=
''
;
22
protected
$links
;
23
24
30
public
function
withTitle
(
string
$title
) :
hasTitle
31
{
32
$clone = clone($this);
33
$clone->title =
$title
;
34
35
return
$clone;
36
}
37
38
42
public
function
getTitle
() : string
43
{
44
return
$this->title
;
45
}
46
47
53
public
function
withLinks
(
$links
) :
LinkList
54
{
55
if
(is_callable(
$links
)) {
56
$links
=
$links
();
57
if
(!is_array(
$links
)) {
58
throw
new
InvalidArgumentException
(
"withLinks only accepts arrays of Links or a callable providing them"
);
59
}
60
}
61
foreach
(
$links
as $link) {
62
if
(!$link instanceof
Link
) {
63
throw
new
InvalidArgumentException
(
"withLinks only accepts arrays of Links or a callable providing them"
);
64
}
65
}
66
$clone = clone($this);
67
$clone->links =
$links
;
68
69
return
$clone;
70
}
71
72
76
public
function
getLinks
() : array
77
{
78
return
$this->links
;
79
}
80
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$links
$links
Definition:
LinkList.php:22
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\getTitle
getTitle()
Definition:
LinkList.php:42
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
Definition:
Complex.php:1
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$title
$title
Definition:
LinkList.php:18
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withLinks
withLinks($links)
Definition:
LinkList.php:53
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:8
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withTitle
withTitle(string $title)
Definition:
LinkList.php:30
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\getLinks
getLinks()
Definition:
LinkList.php:76
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\Link
Class Link.
Definition:
Link.php:15
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList
Definition:
LinkList.php:12
php
InvalidArgumentException
hasTitle
AbstractChildItem
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
Class AbstractBaseItem.
Definition:
AbstractChildItem.php:11
src
GlobalScreen
Scope
MainMenu
Factory
Item
LinkList.php
Generated on Thu Jan 16 2025 19:02:37 for ILIAS by
1.8.13 (using
Doxyfile
)