コード例 #1
0
 /**
  * Update Conversion Profile by ID
  * 
  * @action update
  * @param int $id
  * @param KalturaConversionProfile $conversionProfile
  * @return KalturaConversionProfile
  */
 public function updateAction($id, KalturaConversionProfile $conversionProfile)
 {
     if ($conversionProfile->name !== null) {
         $conversionProfile->validatePropertyMinLength("name", 1);
     }
     if ($conversionProfile->flavorParamsIds !== null) {
         $conversionProfile->validateFlavorParamsIds();
     }
     $conversionProfileDb = conversionProfile2Peer::retrieveByPK($id);
     if (!$conversionProfileDb) {
         throw new KalturaAPIException(KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $id);
     }
     $conversionProfile->toUpdatableObject($conversionProfileDb);
     $conversionProfileDb->setCreationMode(conversionProfile2::CONVERSION_PROFILE_2_CREATION_MODE_KMC);
     $conversionProfileDb->save();
     if ($conversionProfile->flavorParamsIds !== null) {
         $this->deleteFlavorParamsRelation($conversionProfileDb);
         $this->addFlavorParamsRelation($conversionProfileDb, $conversionProfile->getFlavorParamsAsArray());
     }
     $conversionProfile->fromObject($conversionProfileDb);
     // load flavor params id with the same connection (master connection) that was used for insert
     $con = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_MASTER);
     $conversionProfile->loadFlavorParamsIds($conversionProfileDb, $con);
     return $conversionProfile;
 }
コード例 #2
0
 public static function fromDbArray($arr)
 {
     $newArr = new KalturaConversionProfileArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaConversionProfile();
         $nObj->fromObject($obj);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
コード例 #3
0
 function update($id, KalturaConversionProfile $conversionProfile)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "conversionProfile", $conversionProfile->toParams());
     $this->client->queueServiceActionCall("conversionprofile", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return null;
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaConversionProfile");
     return $resultObject;
 }
 /**
  * Update Conversion Profile by ID
  * 
  * @action update
  * @param int $id
  * @param KalturaConversionProfile $conversionProfile
  * @return KalturaConversionProfile
  */
 public function updateAction($id, KalturaConversionProfile $conversionProfile)
 {
     $conversionProfileDb = conversionProfile2Peer::retrieveByPK($id);
     if (!$conversionProfileDb) {
         throw new KalturaAPIException(KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $id);
     }
     $conversionProfile->toUpdatableObject($conversionProfileDb);
     $conversionProfileDb->setCreationMode(conversionProfile2::CONVERSION_PROFILE_2_CREATION_MODE_KMC);
     if ($conversionProfile->xslTransformation) {
         $conversionProfileDb->incrementXslVersion();
     }
     $conversionProfileDb->save();
     if ($conversionProfile->flavorParamsIds !== null) {
         $this->deleteFlavorParamsRelation($conversionProfileDb, $conversionProfile->flavorParamsIds);
         $this->addFlavorParamsRelation($conversionProfileDb, $conversionProfile->getFlavorParamsAsArray());
     }
     if ($conversionProfile->xslTransformation) {
         $xsl = html_entity_decode($conversionProfile->xslTransformation);
         $key = $conversionProfileDb->getSyncKey(conversionProfile2::FILE_SYNC_MRSS_XSL);
         kFileSyncUtils::file_put_contents($key, $xsl);
     }
     $conversionProfile->fromObject($conversionProfileDb);
     // load flavor params id with the same connection (master connection) that was used for insert
     $con = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_MASTER);
     $conversionProfile->loadFlavorParamsIds($conversionProfileDb, $con);
     return $conversionProfile;
 }