ILIAS  release_8 Revision v8.24
class.ModeFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21namespace ILIAS\Survey\Mode;
22
26
31{
33 protected array $providers;
35
36 public function __construct()
37 {
38 $this->providers = [
43 ];
44 }
45
47 {
48 $this->service = $service;
49 }
50
51 public function getModeById(int $id): ModeProvider
52 {
53 foreach ($this->providers as $provider) {
54 if ($provider->getId() === $id) {
55 $provider->setInternalService($this->service);
56 return $provider;
57 }
58 }
59 throw new ModeException("Unknown mode: " . $id);
60 }
61}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
setInternalService(InternalService $service)
$provider
Definition: ltitoken.php:83
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...