ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Bundle.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ilObjUser;
26
27final class Bundle implements SelfRegistration
28{
32 public function __construct(
33 private readonly array $self_registrations
34 ) {
35 }
36
37 public function legacyInputGUIs(): array
38 {
39 return array_merge(...$this->callAll(__FUNCTION__));
40 }
41
42 public function saveLegacyForm(ilPropertyFormGUI $form): bool
43 {
44 $and = fn($a, $b) => $a && $b;
45 return array_reduce($this->callAll(__FUNCTION__, $form), $and, true);
46 }
47
48 public function userCreation(ilObjUser $user): void
49 {
50 $this->callAll(__FUNCTION__, $user);
51 }
52
53 private function callAll(string $call_what, ...$args): array
54 {
55 return array_map(fn($reg) => $reg->$call_what(...$args), $this->self_registrations);
56 }
57}
__construct(private readonly array $self_registrations)
Definition: Bundle.php:32
User class.
This class represents a property form user interface.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples