ILIAS  release_7 Revision v7.30-3-g800a261c036
ConcatenationJob.php
Go to the documentation of this file.
1<?php
2
4
12use ILIAS\BackgroundTasks\ValueType;
13
15{
16
23 public function run(array $input, Observer $observer)
24 {
26 $list = $input[0]->getList();
28 $values = array_map(
29 function ($a) {
30 return $a->getValue();
31 },
32 $list
33 );
34
35 $string_value = new StringValue();
36 $string_value->setValue(implode(', ', $values));
37
38 return $string_value;
39 }
40
41
46 public function isStateless()
47 {
48 return true;
49 }
50
51
55 public function getId()
56 {
57 return get_called_class();
58 }
59
60
64 public function getInputTypes()
65 {
66 return [new ListType(ScalarValue::class)];
67 }
68
69
73 public function getOutputType()
74 {
75 return new SingleType(StringValue::class);
76 }
77
78
83 {
84 return 1;
85 }
86}
An exception for terminatinating execution or to throw for unit testing.
getExpectedTimeOfTaskInSeconds()
int the amount of seconds this task usually taskes. If your task-duration scales with the the amount ...
run(array $input, Observer $observer)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples