1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Overblog\GraphQLBundle\Relay\Connection\Output; |
6
|
|
|
|
7
|
|
|
use Overblog\GraphQLBundle\Relay\Connection\PageInfoInterface; |
8
|
|
|
|
9
|
|
|
class PageInfo implements PageInfoInterface |
10
|
|
|
{ |
11
|
|
|
use DeprecatedPropertyPublicAccessTrait; |
12
|
|
|
|
13
|
|
|
/** @var string */ |
14
|
|
|
protected $startCursor; |
15
|
|
|
|
16
|
|
|
/** @var string */ |
17
|
|
|
protected $endCursor; |
18
|
|
|
|
19
|
|
|
/** @var bool */ |
20
|
|
|
protected $hasPreviousPage; |
21
|
|
|
|
22
|
|
|
/** @var bool */ |
23
|
|
|
protected $hasNextPage; |
24
|
|
|
|
25
|
88 |
|
public function __construct(string $startCursor = null, string $endCursor = null, bool $hasPreviousPage = null, bool $hasNextPage = null) |
26
|
|
|
{ |
27
|
88 |
|
$this->startCursor = $startCursor; |
28
|
88 |
|
$this->endCursor = $endCursor; |
29
|
88 |
|
$this->hasPreviousPage = $hasPreviousPage; |
30
|
88 |
|
$this->hasNextPage = $hasNextPage; |
31
|
88 |
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @return string |
35
|
|
|
*/ |
36
|
58 |
|
public function getStartCursor(): ?string |
37
|
|
|
{ |
38
|
58 |
|
return $this->startCursor; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @param string $startCursor |
43
|
|
|
*/ |
44
|
1 |
|
public function setStartCursor(string $startCursor): void |
45
|
|
|
{ |
46
|
1 |
|
$this->startCursor = $startCursor; |
47
|
1 |
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @return string |
51
|
|
|
*/ |
52
|
58 |
|
public function getEndCursor(): ?string |
53
|
|
|
{ |
54
|
58 |
|
return $this->endCursor; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @param string $endCursor |
59
|
|
|
*/ |
60
|
1 |
|
public function setEndCursor(string $endCursor): void |
61
|
|
|
{ |
62
|
1 |
|
$this->endCursor = $endCursor; |
63
|
1 |
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return bool |
67
|
|
|
*/ |
68
|
66 |
|
public function getHasPreviousPage(): ?bool |
69
|
|
|
{ |
70
|
66 |
|
return $this->hasPreviousPage; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param bool $hasPreviousPage |
75
|
|
|
*/ |
76
|
1 |
|
public function setHasPreviousPage(bool $hasPreviousPage): void |
77
|
|
|
{ |
78
|
1 |
|
$this->hasPreviousPage = $hasPreviousPage; |
79
|
1 |
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return bool |
83
|
|
|
*/ |
84
|
67 |
|
public function getHasNextPage(): ?bool |
85
|
|
|
{ |
86
|
67 |
|
return $this->hasNextPage; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param bool $hasNextPage |
91
|
|
|
*/ |
92
|
1 |
|
public function setHasNextPage(bool $hasNextPage): void |
93
|
|
|
{ |
94
|
1 |
|
$this->hasNextPage = $hasNextPage; |
95
|
1 |
|
} |
96
|
|
|
} |
97
|
|
|
|