Source of file ListRecordings.php

Size: 1,428 Bytes - Last Modified: 2018-11-03T09:50:48-04:00

G:/AdobeConnectClient/src/Commands/ListRecordings.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
<?php

namespace AdobeConnectClient\Commands;

use AdobeConnectClient\Command;
use AdobeConnectClient\Entities\SCORecord;
use AdobeConnectClient\Converter\Converter;
use AdobeConnectClient\Helpers\StatusValidate;
use AdobeConnectClient\Helpers\SetEntityAttributes as FillObject;

/**
 * Provides a list of recordings (FLV and MP4) for a specified folder or SCO
 *
 * More info see {@link https://helpx.adobe.com/adobe-connect/webservices/list-recordings.html}
 */
class ListRecordings extends Command
{
    /**
     * @var int
     */
    protected $folderId;

    /**
     * @param int $folderId
     */
    public function __construct($folderId)
    {
        $this->folderId = (int) $folderId;
    }

    /**
     * @inheritdoc
     *
     * @return SCORecord[]
     */
    protected function process()
    {
        $response = Converter::convert(
            $this->client->doGet([
                'action' => 'list-recordings',
                'folder-id' => $this->folderId,
                'session' => $this->client->getSession()
            ])
        );

        StatusValidate::validate($response['status']);

        $recordings = [];

        foreach ($response['recordings'] as $recordingAttributes) {
            $scoRecording = new SCORecord();
            FillObject::setAttributes($scoRecording, $recordingAttributes);
            $recordings[] = $scoRecording;
        }

        return $recordings;
    }
}