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\Glossary;
22 
33 
35 {
37 
38  protected static array $instance = [];
39 
40  public function __construct(
42  protected InternalRepoService $repo_service,
43  protected InternalDataService $data_service
44  ) {
45  $this->initDomainServices($DIC);
46  }
47 
48  public function log(): \ilLogger
49  {
50  return $this->logger()->glo();
51  }
52 
53  public function term(\ilObjGlossary $glossary, int $user_id = 0): TermManager
54  {
55  if ($user_id == 0) {
56  $user_id = $this->user()->getId();
57  }
58  return new TermManager(
59  $this,
60  $this->repo_service->termSession(),
61  $glossary,
62  $user_id
63  );
64  }
65 
66  public function flashcard(int $glo_ref_id = 0, int $user_id = 0): FlashcardManager
67  {
68  if ($user_id == 0) {
69  $user_id = $this->user()->getId();
70  }
71  return new FlashcardManager(
72  $this,
73  $this->repo_service,
74  $this->data_service,
75  $glo_ref_id,
76  $user_id
77  );
78  }
79 
80  public function flashcardShuffle(): FlashcardShuffleManager
81  {
82  return new FlashcardShuffleManager();
83  }
84 
85  public function metadata(): MetadataManager
86  {
87  return new MetadataManager($this->learningObjectMetadata());
88  }
89 
90  public function presentation(\ilObjGlossary $glossary, int $user_id = 0): PresentationManager
91  {
92  if ($user_id == 0) {
93  $user_id = $this->user()->getId();
94  }
95  return new PresentationManager(
96  $this,
97  $this->repo_service->presentationSession(),
98  $glossary,
99  $user_id
100  );
101  }
102 
103  public function taxonomy(\ilObjGlossary $glossary): TaxonomyManager
104  {
105  return new TaxonomyManager(
106  $this->DIC->taxonomy()->domain(),
107  $glossary
108  );
109  }
110 
111  public function table(): TableManager
112  {
113  return new TableManager();
114  }
115 
116  public function glossarySettings(): SettingsManager
117  {
118  return self::$instance["settings"] ??= new SettingsManager(
119  $this->data_service,
120  $this->repo_service,
121  $this
122  );
123  }
124 
125 }
flashcard(int $glo_ref_id=0, int $user_id=0)
presentation(\ilObjGlossary $glossary, int $user_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initDomainServices(\ILIAS\DI\Container $DIC)
__construct(Container $DIC, protected InternalRepoService $repo_service, protected InternalDataService $data_service)
global $DIC
Definition: shib_login.php:26
term(\ilObjGlossary $glossary, int $user_id=0)