ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjectDIC.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Object;
22 
23 use ILIAS\Object\Properties\ObjectTypeSpecificProperties\Factory as ObjectTypeSpecificPropertiesFactory;
32 
34 {
35  private static ?ilObjectDIC $dic = null;
36 
37  public static function dic(): self
38  {
39  if (self::$dic === null) {
40  global $DIC;
41  self::$dic = new ilObjectDIC();
42  self::$dic->init($DIC);
43  }
44 
45  return self::$dic;
46  }
47 
48  private function init(ILIASContainer $DIC): void
49  {
50  $this['common_settings'] = fn($c): \ilObjectCommonSettings => new \ilObjectCommonSettings(
51  $DIC['lng'],
52  $DIC['upload'],
53  $DIC['resource_storage'],
54  $DIC['http'],
55  $c['tile_image_stackholder'],
56  $c['tile_image_flavour']
57  );
58 
59  $this['object_properties_agregator'] = fn($c): \ilObjectPropertiesAgregator => new \ilObjectPropertiesAgregator(
60  $c['core_properties_repository'],
61  $c['additional_properties_repository'],
62  $c['object_type_specific_properties_factory']
63  );
64 
65  $this['core_properties_repository'] = fn($c): \ilObjectCorePropertiesRepository
66  => new \ilObjectCorePropertiesCachedRepository(
67  $DIC['ilDB'],
68  $DIC['objDefinition'],
69  $DIC['resource_storage'],
70  $c['tile_image_stackholder'],
72  $c['object_type_specific_properties_factory']
73  );
74 
75  $this['multi_object_properties_manipulator'] = fn($c): MultiObjectPropertiesManipulator
77  $c['object_reference_repository'],
78  $c['object_properties_agregator'],
79  $DIC['lng'],
80  $DIC['ilCtrl'],
81  $DIC['ilUser'],
82  $DIC['ui.factory'],
83  $DIC['tpl'],
84  $DIC['refinery']
85  );
86 
87  $this['additional_properties_repository'] = fn($c): \ilObjectAdditionalPropertiesRepository
88  => new \ilObjectAdditionalPropertiesLegacyRepository(
89  $DIC['object.customicons.factory'],
90  $c['object_type_specific_properties_factory']
91  );
92 
93  $this['tile_image_stackholder'] = static fn($c): ilObjectTileImageStakeholder
95 
96  $this['tile_image_flavour'] = static fn($c): ilObjectTileImageFlavourDefinition
98 
99  $this['object_type_specific_properties_factory'] = fn($c): ObjectTypeSpecificPropertiesFactory
100  => new ObjectTypeSpecificPropertiesFactory(
103  : [],
104  $DIC['ilDB']
105  );
106 
107  $this['object_reference_repository'] = fn($c): ObjectReferencePropertiesCachedRepository
109  $c['availability_period_repository'],
110  $DIC['ilDB']
111  );
112 
113  $this['availability_period_repository'] = fn($c): ObjectAvailabilityPeriodPropertiesCachedRepository
115  $DIC['ilDB'],
116  $DIC['tree']
117  );
118  }
119 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static ilObjectDIC $dic
Definition: ilObjectDIC.php:35
init(ILIASContainer $DIC)
Definition: ilObjectDIC.php:48
$dic
Definition: result.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: ilObjectDIC.php:21