ILIAS  release_8 Revision v8.24
class.ilSCComponentTaskFactory.php
Go to the documentation of this file.
1<?php
2
3declare(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}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getTask(int $a_group_id, int $a_task_id)
static getComponentTaskGUIForGroup(int $a_group_id, ?int $a_task_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupComponent(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupGroupId(int $a_task_id)
static lookupIdentifierForTask(int $a_task_id)
Handles tree tasks.