Source of file ScoInfo.php

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

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
<?php

namespace AdobeConnectClient\Commands;

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

/**
 * Gets the Sco info
 *
 * More info see {@link https://helpx.adobe.com/adobe-connect/webservices/sco-info.html}
 */
class ScoInfo extends Command
{
    /**
     * @var int
     */
    protected $scoId;

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

    /**
     * @inheritdoc
     *
     * @return SCO
     */
    protected function process()
    {
        $response = Converter::convert(
            $this->client->doGet([
                'action' => 'sco-info',
                'sco-id' => $this->scoId,
                'session' => $this->client->getSession()
            ])
        );
        StatusValidate::validate($response['status']);
        $sco = new SCO();
        FillObject::setAttributes($sco, $response['sco']);
        return $sco;
    }
}