Completed
Push — master ( d4a365...c9acbc )
by
unknown
19:08 queued 13:13
created

VideosRequestParameters::setIncludeKeywords()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace MovingImage\Client\VMPro\Entity;
4
5
use MovingImage\VMProApiClient\Util\AccessorTrait;
6
7
/**
8
 * Class VideosRequestParameters.
9
 *
10
 * @method int getChannelId()
11
 * @method VideosRequestParameters setChannelId(int $channelId)
12
 * @method int getOffset()
13
 * @method VideosRequestParameters setOffset(int $offset)
14
 * @method int getLimit()
15
 * @method VideosRequestParameters setLimit(int $limit)
16
 * @method string getOrder()
17
 * @method string getOrderProperty()
18
 * @method VideosRequestParameters setOrderProperty(string $orderProperty)
19
 * @method string getSearchTerm()
20
 * @method VideosRequestParameters setSearchTerm(string $searchTerm)
21
 * @method bool isIncludeCustomMetadata()
22
 * @method VideosRequestParameters setIncludeCustomMetadata(bool $includeCustomMetadata)
23
 * @method string getCustomMetadataField()
24
 * @method VideosRequestParameters setCustomMetadataField(int $customMetadataField)
25
 * @method string getSearchInField()
26
 * @method VideosRequestParameters setSearchInField(string $searchInField)
27
 * @method string getPublicationState()
28
 * @method VideosRequestParameters setPublicationState(string $publicationState)
29
 * @method bool isIncludeKeywords()
30
 * @method VideosRequestParameters setIncludeKeywords(bool $includeKeywords)
31
 *
32
 * @author Omid Rad <[email protected]>
33
 */
34
class VideosRequestParameters
35
{
36
    use AccessorTrait;
37
38
    /**
39
     * @param string $order
40
     *
41
     * @return VideosRequestParameters
42
     */
43
    public function setOrder($order)
44
    {
45
        $pool = ['asc', 'desc'];
46
47
        // Silently ignore wrong values
48
        if (in_array($order, $pool)) {
49
            $this->container['order'] = $order;
50
        }
51
52
        return $this;
53
    }
54
}
55