ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
RepositoryLink.php
Go to the documentation of this file.
2 
15 use ilLink;
16 use ilObject2;
17 
25 {
26  use hasSymbolTrait;
29 
33  protected $ref_id = 0;
37  protected $alt_text;
41  protected $title = '';
42 
47  public function withTitle(string $title) : hasTitle
48  {
49  $clone = clone($this);
50  $clone->title = $title;
51 
52  return $clone;
53  }
54 
58  public function getTitle() : string
59  {
60  return $this->title;
61  }
62 
67  public function withAltText(string $alt_text) : RepositoryLink
68  {
69  $clone = clone($this);
70  $clone->alt_text = $alt_text;
71 
72  return $clone;
73  }
74 
78  public function getAltText() : string
79  {
80  return $this->alt_text;
81  }
82 
86  final public function getAction() : string
87  {
88  return ilLink::_getLink($this->ref_id);
89  }
90 
95  public function withAction(string $action) : hasAction
96  {
97  $clone = clone $this;
98  $clone->ref_id = (int) $action;
99 
100  return $clone;
101  }
102 
107  public function withRefId(int $ref_id) : RepositoryLink
108  {
109  $clone = clone $this;
110  $clone->ref_id = $ref_id;
111 
112  return $clone;
113  }
114 
115  public function getSymbol() : Symbol
116  {
117  return $this->symbol;
118  }
119 
123  public function getRefId() : int
124  {
125  return $this->ref_id;
126  }
127 
131  public function withIsLinkToExternalAction(bool $is_external) : hasAction
132  {
133  throw new \LogicException("Repository-Links are always internal");
134  }
135 
139  public function isLinkWithExternalAction() : bool
140  {
141  return false;
142  }
143 }
This describes a symbol.
Definition: Symbol.php:11
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:11
trait hasSymbolTrait
Trait hasSymbolTrait.