ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilQuestionPoolDIC.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
22 
24 
26 {
27  public static ?Container $dic = null;
28 
29  public static function dic(): Container
30  {
31  if (!self::$dic) {
32  self::$dic = self::buildDIC();
33  }
34  return self::$dic;
35  }
36 
37  protected static function buildDIC(): Container
38  {
39  global $DIC;
40  $dic = $DIC;
41  $container = new Container();
42 
43  $dic['question.repo.suggestedsolutions'] = function ($c) use ($dic): assQuestionSuggestedSolutionsDatabaseRepository {
44  return new assQuestionSuggestedSolutionsDatabaseRepository($dic['ilDB']);
45  };
46 
47  return $dic;
48  }
49 }
$container
Definition: wac.php:14
global $DIC
Definition: feed.php:28
$dic
Definition: result.php:32