Completed
Push — master ( 540370...4c31d8 )
by Rafael
06:09
created

PageInfo::setPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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
     * @var int
50
     *
51
     * @GraphQL\Field(type="int")
52
     */
53
    protected $page = 0;
54
55
    /**
56
     * @return string
57
     */
58 6
    public function getStartCursor(): ?string
59
    {
60 6
        return $this->startCursor;
61
    }
62
63
    /**
64
     * @param string $startCursor
65
     *
66
     * @return PageInfo
67
     */
68 6
    public function setStartCursor(string $startCursor): PageInfo
69
    {
70 6
        $this->startCursor = $startCursor;
71
72 6
        return $this;
73
    }
74
75
    /**
76
     * @return string
77
     */
78 6
    public function getEndCursor(): ?string
79
    {
80 6
        return $this->endCursor;
81
    }
82
83
    /**
84
     * @param string $endCursor
85
     *
86
     * @return PageInfo
87
     */
88 6
    public function setEndCursor(string $endCursor): PageInfo
89
    {
90 6
        $this->endCursor = $endCursor;
91
92 6
        return $this;
93
    }
94
95
    /**
96
     * @return bool
97
     */
98 6
    public function isHasNextPage(): bool
99
    {
100 6
        return $this->hasNextPage;
101
    }
102
103
    /**
104
     * @param bool $hasNextPage
105
     *
106
     * @return PageInfo
107
     */
108 6
    public function setHasNextPage(bool $hasNextPage): PageInfo
109
    {
110 6
        $this->hasNextPage = $hasNextPage;
111
112 6
        return $this;
113
    }
114
115
    /**
116
     * @return bool
117
     */
118 6
    public function isHasPreviousPage(): bool
119
    {
120 6
        return $this->hasPreviousPage;
121
    }
122
123
    /**
124
     * @param bool $hasPreviousPage
125
     *
126
     * @return PageInfo
127
     */
128 6
    public function setHasPreviousPage(bool $hasPreviousPage): PageInfo
129
    {
130 6
        $this->hasPreviousPage = $hasPreviousPage;
131
132 6
        return $this;
133
    }
134
135
    /**
136
     * @return int
137
     */
138
    public function getPage(): int
139
    {
140
        return $this->page;
141
    }
142
143
    /**
144
     * @param int $page
145
     *
146
     * @return PageInfo
147
     */
148 6
    public function setPage(int $page): PageInfo
149
    {
150 6
        $this->page = $page;
151
152 6
        return $this;
153
    }
154
}
155