ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Factory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\Poll\Image\Handler as ilPollImage;
25use ILIAS\Poll\Image\I\FactoryInterface as ilPollImageFactoryInterface;
26use ILIAS\Poll\Image\I\HandlerInterface as ilPollImageInterface;
27use ILIAS\Poll\Image\I\Repository\FactoryInterface as ilPollImageRepositoryFactoryInterface;
28use ILIAS\Poll\Image\Repository\Factory as ilPollImageRepositoryFactory;
29use ILIAS\ResourceStorage\Services as ilResourceStorageServices;
30
31class Factory implements ilPollImageFactoryInterface
32{
33 protected ilDBInterface $db;
34 protected ilResourceStorageServices $irss;
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}
ilDBInterface $db
Definition: Factory.php:33
ilResourceStorageServices $irss
Definition: Factory.php:34
Interface ilDBInterface.
global $DIC
Definition: shib_login.php:26