ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Survey\Mode\ModeFactory Class Reference
+ Collaboration diagram for ILIAS\Survey\Mode\ModeFactory:

Public Member Functions

 __construct ()
 
 setInternalService (InternalService $service)
 
 getModeById (int $id)
 

Protected Attributes

array $providers
 
InternalService $service
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 30 of file class.ModeFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Mode\ModeFactory::__construct ( )

Definition at line 36 of file class.ModeFactory.php.

37  {
38  $this->providers = [
39  new Standard\ModeProvider(),
40  new Feedback360\ModeProvider(),
41  new SelfEvaluation\ModeProvider(),
42  new IndividualFeedback\ModeProvider()
43  ];
44  }

Member Function Documentation

◆ getModeById()

ILIAS\Survey\Mode\ModeFactory::getModeById ( int  $id)

Definition at line 51 of file class.ModeFactory.php.

References $id, $provider, and ILIAS\Survey\Mode\ModeProvider\setInternalService().

51  : 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  }
$provider
Definition: ltitoken.php:83
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ setInternalService()

ILIAS\Survey\Mode\ModeFactory::setInternalService ( InternalService  $service)

Definition at line 46 of file class.ModeFactory.php.

References ILIAS\Survey\Mode\ModeFactory\$service.

46  : void
47  {
48  $this->service = $service;
49  }

Field Documentation

◆ $providers

array ILIAS\Survey\Mode\ModeFactory::$providers
protected

Definition at line 33 of file class.ModeFactory.php.

◆ $service

InternalService ILIAS\Survey\Mode\ModeFactory::$service
protected

The documentation for this class was generated from the following file: