ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilSCComponentTaskFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
25 {
26  public static function getComponentTaskGUIForGroup(int $a_group_id, ?int $a_task_id = null): ?ilSCComponentTaskGUI
27  {
28  $component_id = ilSCGroup::lookupComponent($a_group_id);
29 
30  $task = null;
31  if ($a_task_id) {
32  $task = self::getTask($a_group_id, $a_task_id);
33  }
34 
35  // this switch should not be used
36  // find class by naming convention and component service
37  switch ($component_id) {
38  case 'tree':
39 
40  return new ilSCTreeTasksGUI($task);
41  }
42  return null;
43  }
44 
45  public static function getTask(int $a_group_id, int $a_task_id): ilSCTask
46  {
47  $component_id = ilSCGroup::lookupComponent($a_group_id);
48  switch ($component_id) {
49  case 'tree':
51  return new ilSCTreeDumpTask($a_task_id);
52  }
53  }
54  return new ilSCTask($a_task_id);
55  }
56 
57  public static function getComponentTask(int $a_task_id): ilSCTreeTasksGUI
58  {
59  $group_id = ilSCTasks::lookupGroupId($a_task_id);
60 
61  return self::getComponentTaskGUIForGroup($group_id, $a_task_id);
62  }
63 }
Defines a system check task.
static getTask(int $a_group_id, int $a_task_id)
Abstract class for component tasks.
static lookupComponent(int $a_id)
static lookupIdentifierForTask(int $a_task_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Factory for component tasks.
static lookupGroupId(int $a_task_id)
Handles tree tasks.
static getComponentTaskGUIForGroup(int $a_group_id, ?int $a_task_id=null)