ILIAS
trunk Revision v12.0_alpha-1227-g7ff6d300864
◀ ilDoc Overview
RepositoryLink.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
;
22
23
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
;
24
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasAction
;
25
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
;
26
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
;
27
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
28
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild
;
29
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
;
30
use ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItemTrait;
31
use
ILIAS\UI\Component\Symbol\Symbol
;
32
use
ilLink
;
33
use LogicException;
34
use
ILIAS\GlobalScreen\Scope\isDecorateable
;
35
use
ILIAS\GlobalScreen\Scope\ComponentDecoratorTrait
;
36
40
class
RepositoryLink
extends
AbstractChildItem
implements
41
hasTitle
,
42
hasAction
,
43
hasSymbol
,
44
isInterchangeableItem
,
45
isChild
,
46
isDecorateable
47
{
48
use
hasSymbolTrait
;
49
use isInterchangeableItemTrait;
50
use
ComponentDecoratorTrait
;
51
52
protected
int
$ref_id
= 0;
53
protected
string
$alt_text
;
54
protected
string
$title
=
''
;
55
59
public
function
withTitle
(
string
$title
):
hasTitle
60
{
61
$clone = clone($this);
62
$clone->title =
$title
;
63
64
return
$clone;
65
}
66
67
public
function
getTitle
(): string
68
{
69
return
$this->title
;
70
}
71
72
public
function
withAltText
(
string
$alt_text
): self
73
{
74
$clone = clone($this);
75
$clone->alt_text =
$alt_text
;
76
77
return
$clone;
78
}
79
80
public
function
getAltText
(): string
81
{
82
return
$this->alt_text
;
83
}
84
85
final
public
function
getAction
(): string
86
{
87
return
ilLink::_getLink($this->ref_id);
88
}
89
90
public
function
withAction
(
string
$action):
hasAction
91
{
92
$clone = clone $this;
93
$clone->ref_id = (
int
) $action;
94
95
return
$clone;
96
}
97
98
public
function
withRefId
(
int
$ref_id
): self
99
{
100
$clone = clone $this;
101
$clone->ref_id =
$ref_id
;
102
103
return
$clone;
104
}
105
106
public
function
getSymbol
():
Symbol
107
{
108
return
$this->symbol;
109
}
110
111
public
function
getRefId
():
int
112
{
113
return
$this->ref_id
;
114
}
115
119
public
function
withIsLinkToExternalAction
(
bool
$is_external):
hasAction
120
{
121
throw
new
LogicException(
"Repository-Links are always internal"
);
122
}
123
127
public
function
isLinkWithExternalAction
(): bool
128
{
129
return
false
;
130
}
131
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
Class AbstractBaseItem.
Definition:
AbstractChildItem.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink
Definition:
RepositoryLink.php:47
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getAltText
getAltText()
Definition:
RepositoryLink.php:80
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\$alt_text
string $alt_text
Definition:
RepositoryLink.php:53
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getSymbol
getSymbol()
Definition:
RepositoryLink.php:106
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withRefId
withRefId(int $ref_id)
Definition:
RepositoryLink.php:98
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getAction
getAction()
Definition:
RepositoryLink.php:85
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withAction
withAction(string $action)
Definition:
RepositoryLink.php:90
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getRefId
getRefId()
Definition:
RepositoryLink.php:111
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withTitle
withTitle(string $title)
Definition:
RepositoryLink.php:59
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withIsLinkToExternalAction
withIsLinkToExternalAction(bool $is_external)
@inheritDoc
Definition:
RepositoryLink.php:119
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\$title
string $title
Definition:
RepositoryLink.php:54
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\isLinkWithExternalAction
isLinkWithExternalAction()
@inheritDoc
Definition:
RepositoryLink.php:127
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\$ref_id
int $ref_id
Definition:
RepositoryLink.php:52
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withAltText
withAltText(string $alt_text)
Definition:
RepositoryLink.php:72
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getTitle
getTitle()
Definition:
RepositoryLink.php:67
ilLink
Definition:
class.ilLink.php:22
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasAction
Interface hasAction.
Definition:
hasAction.php:28
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Definition:
hasSymbol.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:28
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild
Interface isChild.
Definition:
isChild.php:30
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
Definition:
isInterchangeableItem.php:29
ILIAS\GlobalScreen\Scope\isDecorateable
Definition:
isDecorateable.php:30
ILIAS\UI\Component\Symbol\Symbol
This describes a symbol.
Definition:
Symbol.php:30
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
Definition:
Complex.php:21
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
trait hasSymbolTrait
Trait hasSymbolTrait.
Definition:
hasSymbolTrait.php:33
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
@inheritDoc
Definition:
hasSymbolTrait.php:64
ILIAS\GlobalScreen\Scope\ComponentDecoratorTrait
trait ComponentDecoratorTrait
Definition:
ComponentDecoratorTrait.php:32
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
components
ILIAS
GlobalScreen
src
Scope
MainMenu
Factory
Item
RepositoryLink.php
Generated on Wed Apr 8 2026 23:04:54 for ILIAS by
1.9.4 (using
Doxyfile
)