Completed
Push — master ( 0f6ac6...c701d2 )
by WEBEWEB
01:05
created

DepartementsResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the geo-api-library package.
5
 *
6
 * (c) 2020 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\GeoAPI\Model\Response;
13
14
use WBW\Library\GeoAPI\Model\AbstractResponse;
15
use WBW\Library\GeoAPI\Model\Departement;
16
17
/**
18
 * Départements response.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Library\GeoAPI\Model\Response
22
 */
23
class DepartementsResponse extends AbstractResponse {
24
25
    /**
26
     * Départements.
27
     *
28
     * @var Departement[]
29
     */
30
    private $departements;
31
32
    /**
33
     * Constructor.
34
     */
35
    public function __construct() {
36
        $this->setDepartements([]);
37
    }
38
39
    /**
40
     * Add a département.
41
     *
42
     * @param Departement $departement The département.
43
     * @return DepartementsResponse Returns this départements response.
44
     */
45
    public function addDepartement(Departement $departement) {
46
        $this->departements[] = $departement;
47
        return $this;
48
    }
49
50
    /**
51
     * Get the départements.
52
     *
53
     * @return Departement[] Returns the départements.
54
     */
55
    public function getDepartements() {
56
        return $this->departements;
57
    }
58
59
    /**
60
     * Set the départements.
61
     *
62
     * @param Departement[] $departements The départements.
63
     * @return DepartementsResponse Returns this départements response.
64
     */
65
    protected function setDepartements(array $departements) {
66
        $this->departements = $departements;
67
        return $this;
68
    }
69
}