ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DomainService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
28 {
29  protected static array $instance = [];
30 
31  public function __construct(
32  protected InternalDataService $data,
33  protected InternalRepoService $repo,
34  protected InternalDomainService $domain
35  ) {
36  }
37 
38  public function deletion(): Deletion
39  {
40  $trash_enabled = (bool) $this->domain->settings()->get('enable_trash');
41  return self::$instance['deletion'] ??= new Deletion(
42  $this->tree(),
43  $this->permission(),
44  $this->event(),
45  $this->object(),
46  $trash_enabled
47  );
48  }
49 
50  protected function permission(): PermissionStandardAdapter
51  {
52  return self::$instance['permission'] ??=
54  $this->domain->access(),
55  $this->domain->rbac()->admin(),
56  $this->tree()
57  );
58  }
59 
60  protected function event(): EventStandardAdapter
61  {
62  return self::$instance['event'] ??=
63  new EventStandardAdapter($this->domain);
64  }
65 
66  protected function object(): ObjectStandardAdapter
67  {
68  return self::$instance['object'] ??=
69  new ObjectStandardAdapter(0);
70  }
71 
72  protected function tree(): TreeStandardAdapter
73  {
74  return self::$instance['tree'] ??=
76  $this->repo,
77  $this->domain->repositoryTree(),
78  $this->domain->user()->getId()
79  );
80  }
81 
82 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)