ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ToolIdentificationProvider.php
Go to the documentation of this file.
2
10{
11
15 public function contextAwareIdentifier(string $identifier_string, bool $ignore_context = false) : IdentificationInterface
16 {
17 if ($ignore_context) {
18 return parent::identifier($identifier_string);
19 }
20 global $DIC;
21
22 $get = $DIC->http()->request()->getQueryParams();
23 if (isset($get['ref_id'])) {
24 $identifier_string .= '_' . $get['ref_id'];
25 }
26
27 return parent::identifier($identifier_string);
28 }
29
30
34 public function identifier(string $identifier_string) : IdentificationInterface
35 {
36 throw new \LogicException('Tools must use contextAwareIdentifier');
37 }
38}
An exception for terminatinating execution or to throw for unit testing.
contextAwareIdentifier(string $identifier_string, bool $ignore_context=false)
@inheritDoc
$DIC
Definition: xapitoken.php:46