1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Netgen\InformationCollection\API\Value; |
6
|
|
|
|
7
|
|
|
use eZ\Publish\API\Repository\Values\Content\Content as APIContent; |
8
|
|
|
use eZ\Publish\API\Repository\Values\ContentType\ContentType; |
9
|
|
|
|
10
|
|
|
final class Content extends ValueObject |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var bool |
14
|
|
|
*/ |
15
|
|
|
protected $hasLocation; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var APIContent |
19
|
|
|
*/ |
20
|
|
|
protected $content; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var ContentType |
24
|
|
|
*/ |
25
|
|
|
protected $contentType; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var Collection |
29
|
|
|
*/ |
30
|
|
|
protected $firstCollection; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var Collection |
34
|
|
|
*/ |
35
|
|
|
protected $lastCollection; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var int |
39
|
|
|
*/ |
40
|
|
|
protected $childCount; |
41
|
|
|
|
42
|
|
|
public function __construct( |
43
|
|
|
APIContent $content, |
44
|
|
|
ContentType $contentType, |
45
|
|
|
Collection $firstCollection, |
46
|
|
|
Collection $lastCollection, |
47
|
|
|
int $childCount, |
48
|
|
|
bool $hasLocation |
49
|
|
|
) { |
50
|
|
|
$this->hasLocation = $hasLocation; |
51
|
|
|
$this->content = $content; |
52
|
|
|
$this->contentType = $contentType; |
53
|
|
|
$this->firstCollection = $firstCollection; |
54
|
|
|
$this->lastCollection = $lastCollection; |
55
|
|
|
$this->childCount = $childCount; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return APIContent |
60
|
|
|
*/ |
61
|
|
|
public function getContent(): APIContent |
62
|
|
|
{ |
63
|
|
|
return $this->content; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return ContentType |
68
|
|
|
*/ |
69
|
|
|
public function getContentType(): ContentType |
70
|
|
|
{ |
71
|
|
|
return $this->contentType; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return Collection |
76
|
|
|
*/ |
77
|
|
|
public function getFirstCollection(): Collection |
78
|
|
|
{ |
79
|
|
|
return $this->firstCollection; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return Collection |
84
|
|
|
*/ |
85
|
|
|
public function getLastCollection(): Collection |
86
|
|
|
{ |
87
|
|
|
return $this->lastCollection; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return int |
92
|
|
|
*/ |
93
|
|
|
public function getCount(): int |
94
|
|
|
{ |
95
|
|
|
return $this->childCount; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return bool |
100
|
|
|
*/ |
101
|
|
|
public function hasLocation(): bool |
102
|
|
|
{ |
103
|
|
|
return $this->hasLocation; |
104
|
|
|
} |
105
|
|
|
} |
106
|
|
|
|