ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
BasicScreenContext.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
21 
24 
30 {
33  protected string $context_identifier = '';
34 
39  public function __construct(string $context_identifier)
40  {
41  $this->context_identifier = $context_identifier;
42  $this->additional_data = new Collection();
43  $this->reference_id = new ReferenceId(0);
44  }
45 
49  public function hasReferenceId(): bool
50  {
51  return $this->reference_id->toInt() > 0;
52  }
53 
57  public function getReferenceId(): ReferenceId
58  {
59  return $this->reference_id;
60  }
61 
65  public function withReferenceId(ReferenceId $reference_id): ScreenContext
66  {
67  $clone = clone $this;
68  $clone->reference_id = $reference_id;
69 
70  return $clone;
71  }
72 
76  public function withAdditionalData(Collection $collection): ScreenContext
77  {
78  $clone = clone $this;
79  $clone->additional_data = $collection;
80 
81  return $clone;
82  }
83 
87  public function getAdditionalData(): Collection
88  {
90  }
91 
95  public function addAdditionalData(string $key, $value): ScreenContext
96  {
97  $this->additional_data->add($key, $value);
98 
99  return $this;
100  }
101 
105  public function getUniqueContextIdentifier(): string
106  {
108  }
109 }
__construct(string $context_identifier)
BasicScreenContext constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193