Completed
Push — feature/api ( 725c17...de88d6 )
by Laurent
01:40
created

GetPilotsWithMissionsQuery::getYear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
namespace flightlog\query;
7
8
/**
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class GetPilotsWithMissionsQuery
12
{
13
14
    /**
15
     * @var int
16
     */
17
    private $year;
18
19
    /**
20
     * @var int
21
     */
22
    private $quarter;
23
24
    /**
25
     * @param int $year
26
     * @param int $quarter
27
     */
28
    public function __construct($year, $quarter = null)
29
    {
30
        $this->quarter = (int) $quarter;
31
        $this->year = (int) $year;
32
    }
33
34
    /**
35
     * @return int
36
     */
37
    public function getYear()
38
    {
39
        return $this->year;
40
    }
41
42
    /**
43
     * @return int
44
     */
45
    public function getQuarter()
46
    {
47
        return $this->quarter;
48
    }
49
50
    /**
51
     * @return bool
52
     */
53
    public function hasQuarter()
54
    {
55
        return !empty($this->quarter);
56
    }
57
58
    /**
59
     * @return bool
60
     */
61
    public function isPilotsOnly()
62
    {
63
        return $this->hasQuarter();
64
    }
65
}
66