ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
HasHelpTopics.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
28 protected array $help_topics = [];
29
33 public function withHelpTopics(Topic ...$topics): static
34 {
35 $clone = clone $this;
36 $clone->help_topics = array_unique($topics, SORT_REGULAR);
37 sort($clone->help_topics);
38 return $clone;
39 }
40
44 public function withAdditionalHelpTopics(Topic ...$topics): static
45 {
46 $clone = clone $this;
47 $clone->help_topics = array_unique(array_merge($this->help_topics, $topics), SORT_REGULAR);
48 sort($clone->help_topics);
49 return $clone;
50 }
51
55 public function getHelpTopics(): array
56 {
57 return $this->help_topics;
58 }
59}
This is just a class that marks a string as a help topic.
Definition: Topic.php:27
withAdditionalHelpTopics(Topic ... $topics)