OrderBy::setField()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
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
use Ynlo\GraphQLBundle\Type\OrderDirectionType;
15
16
/**
17
 * @GraphQL\InputObjectType()
18
 */
19
class OrderBy
20
{
21
    /**
22
     * @var string
23
     *
24
     * @GraphQL\Field(type="string!")
25
     */
26
    protected $field;
27
28
    /**
29
     * @var string
30
     *
31
     * @GraphQL\Field(type="Ynlo\GraphQLBundle\Type\OrderDirectionType")
32
     */
33
    protected $direction = OrderDirectionType::ASC;
34
35
    /**
36
     * @return string
37
     */
38
    public function getField(): string
39
    {
40
        return $this->field;
41
    }
42
43
    /**
44
     * @param string $field
45
     *
46
     * @return OrderBy
47
     */
48
    public function setField(string $field): OrderBy
49
    {
50
        $this->field = $field;
51
52
        return $this;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getDirection(): string
59
    {
60
        return $this->direction;
61
    }
62
63
    /**
64
     * @param string $direction
65
     *
66
     * @return OrderBy
67
     */
68
    public function setDirection(string $direction): OrderBy
69
    {
70
        $this->direction = $direction;
71
72
        return $this;
73
    }
74
}
75