ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\LegalDocuments\Internal Class Reference
+ Collaboration diagram for ILIAS\LegalDocuments\Internal:

Public Member Functions

 __construct (Closure $create_provide, Closure $create_wiring, ?array $consumer_classes=null)
 
 all (string $name)
 
 get (string $name, string $key)
 

Static Public Member Functions

static path ()
 

Private Attributes

readonly array $map
 

Detailed Description

Definition at line 25 of file Internal.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Internal::__construct ( Closure  $create_provide,
Closure  $create_wiring,
?array  $consumer_classes = null 
)
Parameters
Closure(string)Provide $create_provide
Closure(string)Wiring $create_wiring
null|list<class-string>$consumer_classes

Definition at line 35 of file Internal.php.

36  {
37  $lens = fn($consumer) => $consumer->uses($create_wiring($consumer->id()), new LazyProvide(fn() => $create_provide($consumer->id())));
38  $this->map = array_reduce(
39  $consumer_classes ?? require self::path(),
40  fn($map, $consumer) => $map->append($lens(new $consumer())->map()),
41  new Map()
42  )->value();
43  }

Member Function Documentation

◆ all()

ILIAS\LegalDocuments\Internal::all ( string  $name)

Definition at line 45 of file Internal.php.

45  : array
46  {
47  return $this->map[$name] ?? [];
48  }

◆ get()

ILIAS\LegalDocuments\Internal::get ( string  $name,
string  $key 
)

Definition at line 50 of file Internal.php.

References ILIAS\LTI\ToolProvider\$key.

51  {
52  return $this->map[$name][$key] ?? null;
53  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ path()

static ILIAS\LegalDocuments\Internal::path ( )
static

Definition at line 55 of file Internal.php.

Referenced by ILIAS\LegalDocuments\Setup\ConsumerObjective\getArtifactPath().

55  : string
56  {
57  return 'Services/LegalDocuments/artifacts/consumers.php';
58  }
+ Here is the caller graph for this function:

Field Documentation

◆ $map

readonly array ILIAS\LegalDocuments\Internal::$map
private

Definition at line 28 of file Internal.php.


The documentation for this class was generated from the following file: