ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.InternalDomainService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Blog;
22 
30 use ILIAS\Notes;
33 
38 {
40 
41  protected static array $instance = [];
42  protected Container $dic;
43 
44  public function __construct(
46  protected InternalRepoService $repo,
47  protected InternalDataService $data
48  ) {
49  $this->initDomainServices($DIC);
50  $this->dic = $DIC;
51  }
52 
53  public function exercise(int $a_node_id): BlogExercise
54  {
55  return new BlogExercise(
56  $a_node_id,
57  $this->repositoryTree(),
58  $this->user()
59  );
60  }
61 
62  public function perm(
63  $access_handler,
64  ?int $node_id,
65  int $id_type,
66  int $user_id,
67  int $owner
69  return new PermissionManager(
70  $access_handler,
71  $node_id,
72  $id_type,
73  $user_id,
74  $owner
75  );
76  }
77 
78  public function readingTime(): ReadingTimeManager
79  {
80  return new ReadingTimeManager();
81  }
82 
83  public function notes(): Notes\DomainService
84  {
85  return $this->dic->notes()->domain();
86  }
87 
88  public function blogSettings(): SettingsManager
89  {
90  return self::$instance["settings"] ??
91  self::$instance["settings"] = new SettingsManager(
92  $this->data,
93  $this->repo,
94  $this
95  );
96  }
97 
98  public function posting(): PostingManager
99  {
100  return self::$instance["posting"] ??= new PostingManager(
101  $this->data,
102  $this->repo,
103  $this
104  );
105  }
106 
107  public function news(): NewsManager
108  {
109  return self::$instance["news"] ??= new NewsManager(
110  $this->data,
111  $this->repo,
112  $this
113  );
114  }
115 
117  {
118  return self::$instance["notification"] ??= new NotificationManager(
119  $this
120  );
121  }
122 
123 }
perm( $access_handler, ?int $node_id, int $id_type, int $user_id, int $owner)
initDomainServices(\ILIAS\DI\Container $DIC)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Domain class for handling news items of blog postings.
global $DIC
Definition: shib_login.php:26
__construct(Container $DIC, protected InternalRepoService $repo, protected InternalDataService $data)