ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
TupleValue.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues
;
4
5
use
ILIAS\BackgroundTasks\Implementation\Values\AbstractValue
;
6
use
ILIAS\BackgroundTasks\Value
;
7
8
class
TupleValue
extends
AbstractValue
9
{
10
14
protected
$values
= [];
18
protected
$type
=
""
;
19
20
26
public
function
__construct
()
27
{
28
}
29
30
38
public
function
serialize
()
39
{
40
return
serialize
($this->values);
41
}
42
43
56
public
function
unserialize
($serialized)
57
{
58
$this->values = $this->
unserialize
($serialized);
59
$this->type = $this->calculateLowestCommonType($this->values);
60
}
61
62
68
public
function
getHash
()
69
{
70
$hashes =
''
;
71
foreach
($this->
getValues
() as $value) {
72
$hashes .= $value->getHash();
73
}
74
75
return
md5($hashes);
76
}
77
78
84
public
function
equals
(
Value
$other)
85
{
86
if
(!$other instanceof
ListValue
) {
87
return
false
;
88
}
89
90
if
($this->
getType
() != $other->
getType
()) {
91
return
false
;
92
}
93
94
$values
= $this->
getValues
();
95
$otherValues = $other->getList();
96
97
if
(count(
$values
) != count($otherValues)) {
98
return
false
;
99
}
100
101
for
(
$i
= 0;
$i
< count(
$values
);
$i
++) {
102
if
(!
$values
[
$i
]->
equals
($otherValues[
$i
])) {
103
;
104
}
105
}
106
107
return
true
;
108
}
109
110
114
public
function
getValues
()
115
{
116
return
$this->values
;
117
}
118
119
124
public
function
getType
()
125
{
126
return
$this->type
;
127
}
128
129
135
private
function
constructType
(
$list
)
136
{
137
return
"("
+ implode(
","
,
$list
->getType()) +
")"
;
138
}
139
140
145
public
function
setValue
(
$values
)
146
{
147
$wrapperFactory = \PrimitiveValueWrapperFactory::getInstance();
148
foreach
(
$values
as $value) {
149
$this->
$values
[] = $wrapperFactory->wrapValue($value);
150
}
151
152
$this->type = $this->
constructType
($this->values);
153
}
154
}
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\getValues
getValues()
Definition:
TupleValue.php:114
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues
Definition:
ListValue.php:3
$list
if(isset($_REQUEST['delete'])) $list
Definition:
registry.php:41
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\getHash
getHash()
Definition:
TupleValue.php:68
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\__construct
__construct()
TupleValue constructor.
Definition:
TupleValue.php:26
ILIAS\BackgroundTasks\Implementation\Values\AbstractValue
Definition:
AbstractValue.php:17
ILIAS\BackgroundTasks\Value\getType
getType()
ILIAS\BackgroundTasks\Value
Definition:
Value.php:15
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\ListValue
Definition:
ListValue.php:24
AbstractValue
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue
Definition:
TupleValue.php:8
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\equals
equals(Value $other)
Definition:
TupleValue.php:84
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\setValue
setValue($values)
Definition:
TupleValue.php:145
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\$values
$values
Definition:
TupleValue.php:14
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\unserialize
unserialize($serialized)
Constructs the object.
Definition:
TupleValue.php:56
$i
$i
Definition:
disco.tpl.php:19
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\serialize
serialize()
String representation of object.
Definition:
TupleValue.php:38
Value
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\constructType
constructType($list)
Definition:
TupleValue.php:135
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\getType
getType()
Definition:
TupleValue.php:124
ILIAS\BackgroundTasks\Implementation\Values\AggregationValues\TupleValue\$type
$type
Definition:
TupleValue.php:18
src
BackgroundTasks
Implementation
Values
AggregationValues
TupleValue.php
Generated on Sat Jan 18 2025 19:01:42 for ILIAS by
1.8.13 (using
Doxyfile
)