ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
StepManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
28{
30
31 public function __construct(
32 protected InternalDataService $data,
34 protected InternalDomainService $domain,
35 ) {
36 $this->repo = $repo->step();
37 }
38
39 public function create(Step $step): int
40 {
41 return $this->repo->create($step);
42 }
43
44 public function update(Step $step): void
45 {
46 $this->repo->update($step);
47 }
48
49 public function getById(int $id): ?Step
50 {
51 return $this->repo->getById($id);
52 }
53
54 public function getStepName(StepType $step_type): string
55 {
56 $lng = $this->domain->lng();
57 return match($step_type) {
58 StepType::Mainbar => $lng->txt("gdtr_mainbar"),
59 StepType::Metabar => $lng->txt("gdtr_metabar"),
60 StepType::Tab => $lng->txt("gdtr_tabs"),
61 StepType::Form => $lng->txt("gdtr_form"),
62 StepType::Table => $lng->txt("gdtr_table"),
63 StepType::PrimaryButton => $lng->txt("gdtr_primary_button"),
64 StepType::Toolbar => $lng->txt("gdtr_toolbar"),
65 };
66 }
67
68
72 public function getStepsOfTour(int $tour_id): \Generator
73 {
74 yield from $this->repo->getStepsOfTour($tour_id);
75 }
76
77 public function countStepsOfTour(int $tour_id): int
78 {
79 return $this->repo->countStepsOfTour($tour_id);
80 }
81
82 public function saveOrder(int $tour_id, array $order): void
83 {
84 $this->repo->saveOrder($tour_id, $order);
85 }
86
87 public function delete(int $tour_id, int $step_id): void
88 {
89 $this->repo->delete($tour_id, $step_id);
90 }
91
92}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
saveOrder(int $tour_id, array $order)
Definition: StepManager.php:82
__construct(protected InternalDataService $data, InternalRepoService $repo, protected InternalDomainService $domain,)
Definition: StepManager.php:31
global $lng
Definition: privfeed.php:31