ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Factory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 use ILIAS\Export\ImportHandler\I\FactoryInterface as ImportHandlerFactoryInterface;
26 use ILIAS\Export\ImportHandler\I\File\FactoryInterface as FileFactoryInterface;
27 use ILIAS\Export\ImportHandler\I\Parser\FactoryInterface as ParserFactoryInterface;
29 use ILIAS\Export\ImportHandler\I\Schema\FactoryInterface as SchemaFactoryInterface;
30 use ILIAS\Export\ImportHandler\I\SchemaFolder\FactoryInterface as SchemaFolderFactoryInterface;
31 use ILIAS\Export\ImportHandler\I\Validation\FactoryInterface as ValidationFactoryInterface;
35 use ILIAS\Export\ImportHandler\SchemaFolder\Factory as SchemaFolderFactory;
37 use ILIAS\Export\ImportHandler\Validation\Factory as ValidationFactory;
38 use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory;
39 use ilLanguage;
40 use ilLogger;
41 
42 class Factory implements ImportHandlerFactoryInterface
43 {
44  protected ilLogger $logger;
45  protected ilLanguage $lng;
46  protected ImportStatusFactory $import_status_factory;
48  protected SchemaFolderInterface $schema_folder;
49 
50  public function __construct()
51  {
52  global $DIC;
53  $this->logger = $DIC->logger()->root();
54  $this->lng = $DIC->language();
55  $this->lng->loadLanguageModule("exp");
56  $this->import_status_factory = new ImportStatusFactory();
57  $this->data_factory = new DataFactory();
58  $this->schema_folder = $this->schemaFolder()->handler();
59  }
60 
61  public function parser(): ParserFactoryInterface
62  {
63  return new ParserFactory(
64  $this,
65  $this->logger
66  );
67  }
68 
69  public function file(): FileFactoryInterface
70  {
71  return new FileFactory(
72  $this,
73  $this->import_status_factory,
74  $this->logger,
75  $this->lng,
76  $this->data_factory,
77  $this->schema_folder
78  );
79  }
80 
81  public function schema(): SchemaFactoryInterface
82  {
83  return new SchemaFactory(
84  $this->schema_folder,
85  $this,
86  $this->data_factory,
87  $this->logger
88  );
89  }
90 
91  public function schemaFolder(): SchemaFolderFactoryInterface
92  {
93  return new SchemaFolderFactory(
94  $this,
95  $this->logger
96  );
97  }
98 
99  public function path(): PathFactoryInterface
100  {
101  return new PathFactory(
102  $this->logger
103  );
104  }
105 
106  public function validation(): ValidationFactoryInterface
107  {
108  return new ValidationFactory(
109  $this->import_status_factory,
110  $this,
111  $this->logger
112  );
113  }
114 }
SchemaFolderInterface $schema_folder
Definition: Factory.php:48
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
ImportStatusFactory $import_status_factory
Definition: Factory.php:46