|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace MovingImage\Client\VMPro\Entity; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class VideosRequestParameters. |
|
7
|
|
|
* |
|
8
|
|
|
* @method int getChannelId() |
|
9
|
|
|
* @method VideosRequestParameters setChannelId(int $channelId) |
|
10
|
|
|
* @method int getOffset() |
|
11
|
|
|
* @method VideosRequestParameters setOffset(int $offset) |
|
12
|
|
|
* @method int getLimit() |
|
13
|
|
|
* @method VideosRequestParameters setLimit(int $limit) |
|
14
|
|
|
* @method string getOrder() |
|
15
|
|
|
* @method string getOrderProperty() |
|
16
|
|
|
* @method VideosRequestParameters setOrderProperty(int $orderProperty) |
|
17
|
|
|
* @method string getSearchTerm() |
|
18
|
|
|
* @method VideosRequestParameters setSearchTerm(int $searchTerm) |
|
19
|
|
|
* @method bool isIncludeCustomMetadata() |
|
20
|
|
|
* @method string getCustomMetadataField() |
|
21
|
|
|
* @method VideosRequestParameters setCustomMetadataField(int $customMetadataField) |
|
22
|
|
|
* @method string getSearchInField() |
|
23
|
|
|
* @method VideosRequestParameters setSearchInField(int $searchInField) |
|
24
|
|
|
* @method string getPublicationState() |
|
25
|
|
|
* @method VideosRequestParameters setPublicationState(int $publicationState) |
|
26
|
|
|
* @method bool isIncludeKeywords() |
|
27
|
|
|
* |
|
28
|
|
|
* @author Omid Rad <[email protected]> |
|
29
|
|
|
*/ |
|
30
|
|
|
class VideosRequestParameters |
|
31
|
|
|
{ |
|
32
|
|
|
private $container = []; |
|
33
|
|
|
|
|
34
|
|
|
function __get($name) |
|
|
|
|
|
|
35
|
|
|
{ |
|
36
|
|
|
if (isset($this->container[$name])) { |
|
37
|
|
|
return $this->container[$name]; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
return null; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @param $name string Key |
|
45
|
|
|
* @param $value string Value |
|
46
|
|
|
* |
|
47
|
|
|
* @return VideosRequestParameters |
|
48
|
|
|
*/ |
|
49
|
|
|
public function __set($name, $value) |
|
50
|
|
|
{ |
|
51
|
|
|
$this->container[$name] = $value; |
|
52
|
|
|
return $this; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @param string $order |
|
57
|
|
|
* @return VideosRequestParameters |
|
58
|
|
|
*/ |
|
59
|
|
|
public function setOrder($order) |
|
60
|
|
|
{ |
|
61
|
|
|
$pool = ['asc', 'desc']; |
|
62
|
|
|
|
|
63
|
|
|
// Silently ignore wrong values |
|
64
|
|
|
if (in_array($order, $pool)) { |
|
65
|
|
|
$this->container['order'] = $order; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
return $this; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @param bool $includeCustomMetadata |
|
73
|
|
|
* @return VideosRequestParameters |
|
74
|
|
|
*/ |
|
75
|
|
|
public function setIncludeCustomMetadata($includeCustomMetadata) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->container['includeCustomMetadata'] = boolval($includeCustomMetadata); |
|
78
|
|
|
return $this; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @param bool $includeKeywords |
|
83
|
|
|
* @return VideosRequestParameters |
|
84
|
|
|
*/ |
|
85
|
|
|
public function setIncludeKeywords($includeKeywords) |
|
86
|
|
|
{ |
|
87
|
|
|
$this->container['includeKeywords'] = boolval($includeKeywords); |
|
88
|
|
|
return $this; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* @return array |
|
93
|
|
|
*/ |
|
94
|
|
|
public function getContainer() |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->container; |
|
97
|
|
|
} |
|
98
|
|
|
} |
|
99
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.