ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Survey\Mode\ModeFactory Class Reference
+ Collaboration diagram for ILIAS\Survey\Mode\ModeFactory:

Public Member Functions

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

Protected Member Functions

 initProviders ()
 

Protected Attributes

array $providers = null
 
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  }

Member Function Documentation

◆ getModeById()

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

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

References $id, $provider, and ILIAS\Survey\Mode\ModeFactory\initProviders().

57  : ModeProvider
58  {
59  $this->initProviders();
60  foreach ($this->providers as $provider) {
61  if ($provider->getId() === $id) {
62  $provider->setInternalService($this->service);
63  return $provider;
64  }
65  }
66  throw new ModeException("Unknown mode: " . $id);
67  }
$provider
Definition: ltitoken.php:80
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ initProviders()

ILIAS\Survey\Mode\ModeFactory::initProviders ( )
protected

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

Referenced by ILIAS\Survey\Mode\ModeFactory\getModeById().

44  : void
45  {
46  if (is_null($this->providers)) {
47  $gui = $this->service->gui();
48  $this->providers = [
49  new Standard\ModeProvider($gui),
50  new Feedback360\ModeProvider($gui),
51  new SelfEvaluation\ModeProvider($gui),
52  new IndividualFeedback\ModeProvider($gui)
53  ];
54  }
55  }
+ Here is the caller graph for this function:

◆ setInternalService()

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

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

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

40  : void
41  {
42  $this->service = $service;
43  }

Field Documentation

◆ $providers

array ILIAS\Survey\Mode\ModeFactory::$providers = null
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: