Completed
Push — master ( 479fbe...e1e56a )
by WEBEWEB
01:15
created

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