|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Extension "sf_event_mgt" for TYPO3 CMS. |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please read the |
|
9
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace DERHANSEN\SfEventMgt\Domain\Model\Registration; |
|
13
|
|
|
|
|
14
|
|
|
use DERHANSEN\SfEventMgt\Domain\Model\Registration; |
|
15
|
|
|
use DERHANSEN\SfEventMgt\Utility\ArrayUtility; |
|
16
|
|
|
use DERHANSEN\SfEventMgt\Utility\FieldValueType; |
|
17
|
|
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; |
|
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
class FieldValue extends AbstractEntity |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* Annotation is required, so propertyMapper will find a suiteable typeConverter |
|
23
|
|
|
* |
|
24
|
|
|
* @var string |
|
25
|
|
|
*/ |
|
26
|
|
|
protected string $value = ''; |
|
27
|
|
|
|
|
28
|
|
|
protected int $valueType = FieldValueType::TYPE_TEXT; |
|
29
|
|
|
protected ?Field $field = null; |
|
30
|
|
|
protected ?Registration $registration = null; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Returns value depending on the valueType |
|
34
|
|
|
* |
|
35
|
|
|
* @return string|array |
|
36
|
|
|
*/ |
|
37
|
|
|
public function getValue() |
|
38
|
|
|
{ |
|
39
|
|
|
$value = $this->value; |
|
40
|
|
|
if ($this->getField() && $this->getField()->getValueType() === FieldValueType::TYPE_ARRAY) { |
|
41
|
|
|
if (ArrayUtility::isJsonArray($value)) { |
|
42
|
|
|
$value = json_decode($value, true); |
|
43
|
|
|
} else { |
|
44
|
|
|
$value = [$this->value]; |
|
45
|
|
|
} |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
return $value; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Returns the field value for CSV export |
|
53
|
|
|
* |
|
54
|
|
|
* @return string |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getValueForCsvExport(): string |
|
57
|
|
|
{ |
|
58
|
|
|
$value = $this->value; |
|
59
|
|
|
if ($this->getField() && $this->getField()->getValueType() === FieldValueType::TYPE_ARRAY && |
|
60
|
|
|
ArrayUtility::isJsonArray($value) |
|
61
|
|
|
) { |
|
62
|
|
|
$value = implode(',', json_decode($value, true)); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
return $value; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function setValue(string $value): void |
|
69
|
|
|
{ |
|
70
|
|
|
$this->value = $value; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function getField(): ?Field |
|
74
|
|
|
{ |
|
75
|
|
|
return $this->field; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
public function setField(?Field $field): void |
|
79
|
|
|
{ |
|
80
|
|
|
$this->field = $field; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function getRegistration(): ?Registration |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->registration; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function setRegistration(?Registration $registration): void |
|
89
|
|
|
{ |
|
90
|
|
|
$this->registration = $registration; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function getValueType(): int |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->valueType; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function setValueType(int $valueType): void |
|
99
|
|
|
{ |
|
100
|
|
|
$this->valueType = $valueType; |
|
101
|
|
|
} |
|
102
|
|
|
} |
|
103
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths