|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace MovingImage\Client\VMPro\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use MovingImage\Client\VMPro\Util\AccessorTrait; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class VideosRequestParameters. |
|
9
|
|
|
* |
|
10
|
|
|
* @method int getVideoId() |
|
11
|
|
|
* @method VideosRequestParameters setVideoId(int $videoId) |
|
12
|
|
|
* @method int getChannelId() |
|
13
|
|
|
* @method VideosRequestParameters setChannelId(int $channelId) |
|
14
|
|
|
* @method int getOffset() |
|
15
|
|
|
* @method VideosRequestParameters setOffset(int $offset) |
|
16
|
|
|
* @method int getLimit() |
|
17
|
|
|
* @method VideosRequestParameters setLimit(int $limit) |
|
18
|
|
|
* @method string getOrder() |
|
19
|
|
|
* @method string getOrderProperty() |
|
20
|
|
|
* @method VideosRequestParameters setOrderProperty(string $orderProperty) |
|
21
|
|
|
* @method string getSearchTerm() |
|
22
|
|
|
* @method VideosRequestParameters setSearchTerm(string $searchTerm) |
|
23
|
|
|
* @method bool isIncludeCustomMetadata() |
|
24
|
|
|
* @method VideosRequestParameters setIncludeCustomMetadata(bool $includeCustomMetadata) |
|
25
|
|
|
* @method string getCustomMetadataField() |
|
26
|
|
|
* @method VideosRequestParameters setCustomMetadataField(int $customMetadataField) |
|
27
|
|
|
* @method string getSearchInField() |
|
28
|
|
|
* @method VideosRequestParameters setSearchInField(string $searchInField) |
|
29
|
|
|
* @method string getPublicationState() |
|
30
|
|
|
* @method bool isIncludeKeywords() |
|
31
|
|
|
* @method VideosRequestParameters setIncludeKeywords(bool $includeKeywords) |
|
32
|
|
|
* @method VideosRequestParameters setIncludeChannelAssignments(bool $includeChannels) |
|
33
|
|
|
* @method bool isIncludeSubChannels() |
|
34
|
|
|
* @method VideosRequestParameters setIncludeSubChannels(bool $includeSubChannels) |
|
35
|
|
|
* |
|
36
|
|
|
* @author Omid Rad <[email protected]> |
|
37
|
|
|
*/ |
|
38
|
|
|
class VideosRequestParameters |
|
39
|
|
|
{ |
|
40
|
|
|
use AccessorTrait; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param string $order |
|
44
|
|
|
* |
|
45
|
|
|
* @return VideosRequestParameters |
|
46
|
|
|
*/ |
|
47
|
|
View Code Duplication |
public function setOrder($order) |
|
|
|
|
|
|
48
|
|
|
{ |
|
49
|
|
|
$pool = ['asc', 'desc']; |
|
50
|
|
|
|
|
51
|
|
|
// Silently ignore wrong values |
|
52
|
|
|
if (in_array($order, $pool)) { |
|
53
|
|
|
$this->container['order'] = $order; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
return $this; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @param string $publicationState |
|
61
|
|
|
* |
|
62
|
|
|
* @return VideosRequestParameters |
|
63
|
|
|
*/ |
|
64
|
|
|
public function setPublicationState($publicationState) |
|
65
|
|
|
{ |
|
66
|
|
|
$pool = ['published', 'not_published', 'all']; |
|
67
|
|
|
|
|
68
|
|
|
if (in_array($publicationState, $pool)) { |
|
69
|
|
|
$this->container['publication_state'] = $publicationState; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
return $this; |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.