Completed
Push — master ( 026ae8...9deabe )
by WEBEWEB
01:12
created

SearchPhotosRequest::getResourcePath()   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 pexels-library package.
5
 *
6
 * (c) 2019 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\Pexels\Request;
13
14
use WBW\Library\Core\Model\Attribute\IntegerPageTrait;
15
use WBW\Library\Core\Model\Attribute\StringQueryTrait;
16
use WBW\Library\Pexels\Model\Attribute\IntegerPerPageTrait;
17
18
/**
19
 * Search photos request.
20
 *
21
 * @author webeweb <https://github.com/webeweb/>
22
 * @package WBW\Library\Pexels\Request
23
 */
24
class SearchPhotosRequest extends AbstractRequest {
25
26
    use IntegerPageTrait;
27
    use IntegerPerPageTrait;
28
    use StringQueryTrait;
29
30
    /**
31
     * Search photos resource path.
32
     *
33
     * @var string
34
     */
35
    const SEARCH_PHOTOS_RESOURCE_PATH = "/v1/search";
36
37
    /**
38
     * Locale.
39
     *
40
     * @var string|null
41
     */
42
    private $locale;
43
44
    /**
45
     * Constructor.
46
     */
47
    public function __construct() {
48
        parent::__construct();
49
        $this->setPage(1);
50
        $this->setPerPage(self::PER_PAGE_DEFAULT);
51
    }
52
53
    /**
54
     * Get the locale.
55
     *
56
     * @return string|null Returns the locale.
57
     */
58
    public function getLocale(): ?string {
59
        return $this->locale;
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65
    public function getResourcePath(): string {
66
        return self::SEARCH_PHOTOS_RESOURCE_PATH;
67
    }
68
69
    /**
70
     * Set the locale.
71
     *
72
     * @param string|null $locale The locale.
73
     * @return SearchPhotosRequest Returns this search photos request.
74
     */
75
    public function setLocale(?string $locale): SearchPhotosRequest {
76
        $this->locale = $locale;
77
        return $this;
78
    }
79
}
80