ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
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 
21 namespace ILIAS\Poll\Image;
22 
23 use ilDBInterface;
24 use ILIAS\Poll\Image\Handler as ilPollImage;
25 use ILIAS\Poll\Image\I\FactoryInterface as ilPollImageFactoryInterface;
26 use ILIAS\Poll\Image\I\HandlerInterface as ilPollImageInterface;
27 use ILIAS\Poll\Image\I\Repository\FactoryInterface as ilPollImageRepositoryFactoryInterface;
28 use ILIAS\Poll\Image\Repository\Factory as ilPollImageRepositoryFactory;
30 
31 class Factory implements ilPollImageFactoryInterface
32 {
33  protected ilDBInterface $db;
35 
36  public function __construct()
37  {
38  global $DIC;
39  $this->db = $DIC->database();
40  $this->irss = $DIC->resourceStorage();
41  }
42 
43  public function repository(): ilPollImageRepositoryFactoryInterface
44  {
45  return new ilPollImageRepositoryFactory(
46  $this->db,
47  $this->irss
48  );
49  }
50 
51  public function handler(): ilPollImageInterface
52  {
53  return new ilPollImage(
54  $this->irss,
55  $this->repository()
56  );
57  }
58 }
ilResourceStorageServices $irss
Definition: Factory.php:34
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
ilDBInterface $db
Definition: Factory.php:33