ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
CombinedActionProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
29 final class CombinedActionProvider implements ActionProvider
30 {
31 
35  private array $providers;
36 
37  public function __construct(ActionProvider ...$providers)
38  {
39  $this->providers = $providers;
40  }
41 
42  public function getTopActions(): array
43  {
44  $actions = [];
45  foreach ($this->providers as $provider) {
46  $actions[] = $provider->getTopActions();
47  }
48  return array_merge([], ... $actions);
49  }
50 
51  public function getSingleActions(Request $view_request): array
52  {
53  $actions = [];
54  foreach ($this->providers as $provider) {
55  $actions[] = $provider->getSingleActions($view_request);
56  }
57  $array_merge = array_merge([], ... $actions);
58  return $array_merge;
59  }
60 
61  public function getComponents(): array
62  {
63  $components = [];
64  foreach ($this->providers as $provider) {
65  $components[] = $provider->getComponents();
66  }
67  return array_merge([], ... $components);
68  }
69 
70 }
$components
$provider
Definition: ltitoken.php:80