ILIAS  release_7 Revision v7.30-3-g800a261c036
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
56 protected $ref_id = 0;
60 protected $alt_text;
64 protected $title = '';
65
70 public function withTitle(string $title) : hasTitle
71 {
72 $clone = clone($this);
73 $clone->title = $title;
74
75 return $clone;
76 }
77
81 public function getTitle() : string
82 {
83 return $this->title;
84 }
85
86 public function withAltText(string $alt_text) : self
87 {
88 $clone = clone($this);
89 $clone->alt_text = $alt_text;
90
91 return $clone;
92 }
93
97 public function getAltText() : string
98 {
99 return $this->alt_text;
100 }
101
105 final public function getAction() : string
106 {
107 return ilLink::_getLink($this->ref_id);
108 }
109
114 public function withAction(string $action) : hasAction
115 {
116 $clone = clone $this;
117 $clone->ref_id = (int) $action;
118
119 return $clone;
120 }
121
122 public function withRefId(int $ref_id) : self
123 {
124 $clone = clone $this;
125 $clone->ref_id = $ref_id;
126
127 return $clone;
128 }
129
130 public function getSymbol() : Symbol
131 {
132 return $this->symbol;
133 }
134
138 public function getRefId() : int
139 {
140 return $this->ref_id;
141 }
142
146 public function withIsLinkToExternalAction(bool $is_external) : hasAction
147 {
148 throw new LogicException("Repository-Links are always internal");
149 }
150
154 public function isLinkWithExternalAction() : bool
155 {
156 return false;
157 }
158}
An exception for terminatinating execution or to throw for unit testing.
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:33
This describes a symbol.
Definition: Symbol.php:12
trait hasSymbolTrait
Trait hasSymbolTrait.