Пример #1
0
 public function __construct(\SimpleXMLElement $xml = null)
 {
     parent::__construct($xml);
     if (is_null($xml)) {
         return;
     }
     if (count($xml->gracePeriod)) {
         $this->gracePeriod = (int) $xml->gracePeriod;
     }
     if (count($xml->licenseRemovalPolicy)) {
         $this->licenseRemovalPolicy = (int) $xml->licenseRemovalPolicy;
     }
     if (count($xml->licenseRemovalDuration)) {
         $this->licenseRemovalDuration = (int) $xml->licenseRemovalDuration;
     }
     if (count($xml->minSecurityLevel)) {
         $this->minSecurityLevel = (int) $xml->minSecurityLevel;
     }
     if (empty($xml->rights)) {
         $this->rights = array();
     } else {
         $this->rights = \Kaltura\Client\ParseUtils::unmarshalArray($xml->rights, "KalturaPlayReadyRight");
     }
 }
Пример #2
0
 /**
  * Update an existing KalturaDrmPolicy object
  * 	 
  * 
  * @return \Kaltura\Client\Plugin\Drm\Type\DrmPolicy
  */
 function update($drmPolicyId, \Kaltura\Client\Plugin\Drm\Type\DrmPolicy $drmPolicy)
 {
     $kparams = array();
     $this->client->addParam($kparams, "drmPolicyId", $drmPolicyId);
     $this->client->addParam($kparams, "drmPolicy", $drmPolicy->toParams());
     $this->client->queueServiceActionCall("drm_drmpolicy", "update", "KalturaDrmPolicy", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultXml = $this->client->doQueue();
     $resultXmlObject = new \SimpleXMLElement($resultXml);
     \Kaltura\Client\ParseUtils::checkIfError($resultXmlObject->result);
     $resultObject = \Kaltura\Client\ParseUtils::unmarshalObject($resultXmlObject->result, "KalturaDrmPolicy");
     $this->client->validateObjectType($resultObject, "\\Kaltura\\Client\\Plugin\\Drm\\Type\\DrmPolicy");
     return $resultObject;
 }