Пример #1
0
 public function validatePolicy()
 {
     if (count($this->rights)) {
         foreach ($this->rights as $right) {
             if ($right instanceof KalturaPlayReadyPlayRight) {
                 $this->validatePlayRight($right);
             } else {
                 if ($right instanceof KalturaPlayReadyCopyRight) {
                     $this->validateCopyRight($right);
                 }
             }
         }
     }
     parent::validatePolicy();
 }
Пример #2
0
 /**
  * Update an existing KalturaDrmPolicy object
  * 
  * @action update
  * @param int $drmPolicyId
  * @param KalturaDrmPolicy $drmPolicy
  * @return KalturaDrmPolicy
  *
  * @throws KalturaErrors::INVALID_OBJECT_ID
  */
 public function updateAction($drmPolicyId, KalturaDrmPolicy $drmPolicy)
 {
     $dbDrmPolicy = DrmPolicyPeer::retrieveByPK($drmPolicyId);
     if (!$dbDrmPolicy) {
         throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $drmPolicyId);
     }
     $drmPolicy->validatePolicy();
     $dbDrmPolicy = $drmPolicy->toUpdatableObject($dbDrmPolicy);
     $dbDrmPolicy->save();
     $drmPolicy = KalturaDrmPolicy::getInstanceByType($dbDrmPolicy->getProvider());
     $drmPolicy->fromObject($dbDrmPolicy, $this->getResponseProfile());
     return $drmPolicy;
 }