ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.DomainService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Survey\Execution;
22 
25 
30 {
33 
34  protected static array $managers = [];
35 
36  public function __construct(
37  InternalRepoService $repo_service,
38  InternalDomainService $domain_service
39  ) {
40  $this->domain_service = $domain_service;
41  $this->repo_service = $repo_service;
42  }
43 
44  public function run(
45  \ilObjSurvey $survey,
46  int $user_id,
47  int $appraisee_id = 0
48  ): RunManager {
49  $appraisee_id = ($survey->getMode() === \ilObjSurvey::MODE_SELF_EVAL)
50  ? $user_id
51  : $appraisee_id;
52  if (!isset(self::$managers[RunManager::class][$survey->getId()][$user_id][$appraisee_id])) {
53  self::$managers[RunManager::class][$survey->getId()][$user_id][$appraisee_id] =
54  new RunManager(
55  $this->repo_service,
56  $this->domain_service,
57  $survey,
58  $user_id,
59  $appraisee_id
60  );
61  }
62  return self::$managers[RunManager::class][$survey->getId()][$user_id][$appraisee_id];
63  }
64 }
run(\ilObjSurvey $survey, int $user_id, int $appraisee_id=0)
__construct(InternalRepoService $repo_service, InternalDomainService $domain_service)
Survey Run Note: The manager should get the current user id passed.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...