Completed
Pull Request — master (#8)
by Omid
25:19
created

VideosRequestParameters::setOrder()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace MovingImage\Client\VMPro\Entity;
4
5
use MovingImage\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(int $orderProperty)
19
 * @method string getSearchTerm()
20
 * @method VideosRequestParameters setSearchTerm(int $searchTerm)
21
 * @method bool isIncludeCustomMetadata()
22
 * @method string getCustomMetadataField()
23
 * @method VideosRequestParameters setCustomMetadataField(int $customMetadataField)
24
 * @method string getSearchInField()
25
 * @method VideosRequestParameters setSearchInField(int $searchInField)
26
 * @method string getPublicationState()
27
 * @method VideosRequestParameters setPublicationState(int $publicationState)
28
 * @method bool isIncludeKeywords()
29
 *
30
 * @author Omid Rad <[email protected]>
31
 */
32
class VideosRequestParameters
33
{
34
    use AccessorTrait;
35
36
    /**
37
     * @param string $order
38
     *
39
     * @return VideosRequestParameters
40
     */
41
    public function setOrder($order)
42
    {
43
        $pool = ['asc', 'desc'];
44
45
        // Silently ignore wrong values
46
        if (in_array($order, $pool)) {
47
            $this->container['order'] = $order;
48
        }
49
50
        return $this;
51
    }
52
53
    /**
54
     * @param bool $includeCustomMetadata
55
     *
56
     * @return VideosRequestParameters
57
     */
58
    public function setIncludeCustomMetadata($includeCustomMetadata)
59
    {
60
        $this->container['includeCustomMetadata'] = boolval($includeCustomMetadata);
61
62
        return $this;
63
    }
64
65
    /**
66
     * @param bool $includeKeywords
67
     *
68
     * @return VideosRequestParameters
69
     */
70
    public function setIncludeKeywords($includeKeywords)
71
    {
72
        $this->container['includeKeywords'] = boolval($includeKeywords);
73
74
        return $this;
75
    }
76
}
77