1
|
|
|
<?php |
2
|
|
|
/******************************************************************************* |
3
|
|
|
* This file is part of the GraphQL Bundle package. |
4
|
|
|
* |
5
|
|
|
* (c) YnloUltratech <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
******************************************************************************/ |
10
|
|
|
|
11
|
|
|
namespace Ynlo\GraphQLBundle\Model; |
12
|
|
|
|
13
|
|
|
use Ynlo\GraphQLBundle\Annotation as GraphQL; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @GraphQL\ObjectType() |
17
|
|
|
*/ |
18
|
|
|
class PageInfo |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var string |
22
|
|
|
* |
23
|
|
|
* @GraphQL\Field(type="string") |
24
|
|
|
*/ |
25
|
|
|
protected $startCursor = null; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var string |
29
|
|
|
* |
30
|
|
|
* @GraphQL\Field(type="string") |
31
|
|
|
*/ |
32
|
|
|
protected $endCursor = null; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var bool |
36
|
|
|
* |
37
|
|
|
* @GraphQL\Field(type="bool!") |
38
|
|
|
*/ |
39
|
|
|
protected $hasNextPage = false; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var bool |
43
|
|
|
* |
44
|
|
|
* @GraphQL\Field(type="bool!") |
45
|
|
|
*/ |
46
|
|
|
protected $hasPreviousPage = false; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return string |
50
|
|
|
*/ |
51
|
10 |
|
public function getStartCursor(): ?string |
52
|
|
|
{ |
53
|
10 |
|
return $this->startCursor; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param string $startCursor |
58
|
|
|
* |
59
|
|
|
* @return PageInfo |
60
|
|
|
*/ |
61
|
10 |
|
public function setStartCursor(string $startCursor): PageInfo |
62
|
|
|
{ |
63
|
10 |
|
$this->startCursor = $startCursor; |
64
|
|
|
|
65
|
10 |
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return string |
70
|
|
|
*/ |
71
|
7 |
|
public function getEndCursor(): ?string |
72
|
|
|
{ |
73
|
7 |
|
return $this->endCursor; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param string $endCursor |
78
|
|
|
* |
79
|
|
|
* @return PageInfo |
80
|
|
|
*/ |
81
|
10 |
|
public function setEndCursor(string $endCursor): PageInfo |
82
|
|
|
{ |
83
|
10 |
|
$this->endCursor = $endCursor; |
84
|
|
|
|
85
|
10 |
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return bool |
90
|
|
|
*/ |
91
|
7 |
|
public function isHasNextPage(): bool |
92
|
|
|
{ |
93
|
7 |
|
return $this->hasNextPage; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param bool $hasNextPage |
98
|
|
|
* |
99
|
|
|
* @return PageInfo |
100
|
|
|
*/ |
101
|
10 |
|
public function setHasNextPage(bool $hasNextPage): PageInfo |
102
|
|
|
{ |
103
|
10 |
|
$this->hasNextPage = $hasNextPage; |
104
|
|
|
|
105
|
10 |
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return bool |
110
|
|
|
*/ |
111
|
7 |
|
public function isHasPreviousPage(): bool |
112
|
|
|
{ |
113
|
7 |
|
return $this->hasPreviousPage; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param bool $hasPreviousPage |
118
|
|
|
* |
119
|
|
|
* @return PageInfo |
120
|
|
|
*/ |
121
|
10 |
|
public function setHasPreviousPage(bool $hasPreviousPage): PageInfo |
122
|
|
|
{ |
123
|
10 |
|
$this->hasPreviousPage = $hasPreviousPage; |
124
|
|
|
|
125
|
10 |
|
return $this; |
126
|
|
|
} |
127
|
|
|
} |
128
|
|
|
|