public function validateForUpdate($sourceObject, $propertiesToSkip = array())
 {
     if (!WidevinePlugin::isAllowedPartner(kCurrentContext::getCurrentPartnerId()) || !WidevinePlugin::isAllowedPartner($sourceObject->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::PERMISSION_NOT_FOUND, 'Permission not found to use the Widevine feature.');
     }
     return parent::validateForUpdate($sourceObject, $propertiesToSkip);
 }
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaDrmProfileArray();
     foreach ($arr as $obj) {
         $nObj = KalturaDrmProfile::getInstanceByType($obj->getProvider());
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 /**
  * Update an existing KalturaDrmProfile object
  * 
  * @param int $drmProfileId 
  * @param KalturaDrmProfile $drmProfile Id
  * @return KalturaDrmProfile
  */
 function update($drmProfileId, KalturaDrmProfile $drmProfile)
 {
     $kparams = array();
     $this->client->addParam($kparams, "drmProfileId", $drmProfileId);
     $this->client->addParam($kparams, "drmProfile", $drmProfile->toParams());
     $this->client->queueServiceActionCall("drm_drmprofile", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaDrmProfile");
     return $resultObject;
 }
示例#4
0
 /**
  * Retrieve a KalturaDrmProfile object by provider, if no specific profile defined return default profile
  * 
  * @action getByProvider
  * @param KalturaDrmProviderType $provider
  * @return KalturaDrmProfile
  */
 public function getByProviderAction($provider)
 {
     $drmProfile = KalturaDrmProfile::getInstanceByType($provider);
     $drmProfile->provider = $provider;
     $tmpDbProfile = $drmProfile->toObject();
     $dbDrmProfile = DrmProfilePeer::retrieveByProvider($tmpDbProfile->getProvider());
     if (!$dbDrmProfile) {
         if ($provider == KalturaDrmProviderType::CENC) {
             $dbDrmProfile = new DrmProfile();
         } else {
             $dbDrmProfile = KalturaPluginManager::loadObject('DrmProfile', $tmpDbProfile->getProvider());
         }
         $dbDrmProfile->setName('default');
         $dbDrmProfile->setProvider($tmpDbProfile->getProvider());
     }
     $drmProfile->fromObject($dbDrmProfile, $this->getResponseProfile());
     return $drmProfile;
 }