ILIAS  release_8 Revision v8.24
RepositoryLink.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30use ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItemTrait;
33use ilLink;
34use LogicException;
35
42class RepositoryLink extends AbstractChildItem implements
48{
51 use isInterchangeableItemTrait;
52
53 protected int $ref_id = 0;
54 protected string $alt_text;
55 protected string $title = '';
56
61 public function withTitle(string $title): hasTitle
62 {
63 $clone = clone($this);
64 $clone->title = $title;
65
66 return $clone;
67 }
68
72 public function getTitle(): string
73 {
74 return $this->title;
75 }
76
77 public function withAltText(string $alt_text): self
78 {
79 $clone = clone($this);
80 $clone->alt_text = $alt_text;
81
82 return $clone;
83 }
84
88 public function getAltText(): string
89 {
90 return $this->alt_text;
91 }
92
96 final public function getAction(): string
97 {
98 return ilLink::_getLink($this->ref_id);
99 }
100
105 public function withAction(string $action): hasAction
106 {
107 $clone = clone $this;
108 $clone->ref_id = (int) $action;
109
110 return $clone;
111 }
112
113 public function withRefId(int $ref_id): self
114 {
115 $clone = clone $this;
116 $clone->ref_id = $ref_id;
117
118 return $clone;
119 }
120
121 public function getSymbol(): Symbol
122 {
123 return $this->symbol;
124 }
125
129 public function getRefId(): int
130 {
131 return $this->ref_id;
132 }
133
137 public function withIsLinkToExternalAction(bool $is_external): hasAction
138 {
139 throw new LogicException("Repository-Links are always internal");
140 }
141
145 public function isLinkWithExternalAction(): bool
146 {
147 return false;
148 }
149}
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:33
This describes a symbol.
Definition: Symbol.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Complex.php:21
trait hasSymbolTrait
Trait hasSymbolTrait.