1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Soheilrt\AdobeConnectClient\Client\Commands; |
4
|
|
|
|
5
|
|
|
use Soheilrt\AdobeConnectClient\Client\Abstracts\Command; |
6
|
|
|
use Soheilrt\AdobeConnectClient\Client\Contracts\ArrayableInterface; |
7
|
|
|
use Soheilrt\AdobeConnectClient\Client\Converter\Converter; |
8
|
|
|
use Soheilrt\AdobeConnectClient\Client\Entities\SCO; |
9
|
|
|
use Soheilrt\AdobeConnectClient\Client\Helpers\SetEntityAttributes as FillObject; |
10
|
|
|
use Soheilrt\AdobeConnectClient\Client\Helpers\StatusValidate; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Get the SCO Contents from a folder or from other SCO. |
14
|
|
|
* |
15
|
|
|
* Use the filter to reduce excessive data returns. |
16
|
|
|
* |
17
|
|
|
* More info see {@link https://helpx.adobe.com/content/help/en/adobe-connect/webservices/sco-contents.html} |
18
|
|
|
*/ |
19
|
|
|
class ScoContents extends Command |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @var array |
23
|
|
|
*/ |
24
|
|
|
protected $parameters; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var SCO|mixed |
28
|
|
|
*/ |
29
|
|
|
protected $sco; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param int $scoId |
33
|
|
|
* @param ArrayableInterface|null $filter |
34
|
|
|
* @param ArrayableInterface|null $sorter |
35
|
|
|
*/ |
36
|
|
|
public function __construct($scoId, ArrayableInterface $filter = null, ArrayableInterface $sorter = null) |
37
|
|
|
{ |
38
|
|
|
$this->parameters = [ |
39
|
|
|
'action' => 'sco-contents', |
40
|
|
|
'sco-id' => (int) $scoId, |
41
|
|
|
]; |
42
|
|
|
|
43
|
|
|
if ($filter) { |
44
|
|
|
$this->parameters += $filter->toArray(); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
if ($sorter) { |
48
|
|
|
$this->parameters += $sorter->toArray(); |
49
|
|
|
} |
50
|
|
|
$this->sco = $this->getEntity('sco'); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* {@inheritdoc} |
55
|
|
|
* |
56
|
|
|
* @return SCO[] |
57
|
|
|
*/ |
58
|
|
|
protected function process() |
59
|
|
|
{ |
60
|
|
|
$response = Converter::convert( |
61
|
|
|
$this->client->doGet($this->parameters + ['session' => $this->client->getSession()]) |
|
|
|
|
62
|
|
|
); |
63
|
|
|
|
64
|
|
|
StatusValidate::validate($response['status']); |
65
|
|
|
|
66
|
|
|
$scos = []; |
67
|
|
|
|
68
|
|
|
foreach ($response['scos'] as $scoAttributes) { |
69
|
|
|
$sco = new $this->sco(); |
70
|
|
|
FillObject::setAttributes($sco, $scoAttributes); |
71
|
|
|
$scos[] = $sco; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
return $scos; |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.