ILIAS  release_7 Revision v7.30-3-g800a261c036
ToolIdentificationProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21
22use LogicException;
29{
33 public function contextAwareIdentifier(string $identifier_string, bool $ignore_context = false) : IdentificationInterface
34 {
35 if ($ignore_context) {
36 return parent::identifier($identifier_string);
37 }
38 global $DIC;
39
40 $get = $DIC->http()->request()->getQueryParams();
41 if (isset($get['ref_id'])) {
42 $identifier_string .= '_' . $get['ref_id'];
43 }
44
45 return parent::identifier($identifier_string);
46 }
47
51 public function identifier(string $identifier_string) : IdentificationInterface
52 {
53 throw new LogicException('Tools must use contextAwareIdentifier');
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
contextAwareIdentifier(string $identifier_string, bool $ignore_context=false)
@inheritDoc
global $DIC
Definition: goto.php:24