当前位置: 首页>>代码示例>>PHP>>正文


PHP entryPeer::retrieveByPKNoFilter方法代码示例

本文整理汇总了PHP中entryPeer::retrieveByPKNoFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer::retrieveByPKNoFilter方法的具体用法?PHP entryPeer::retrieveByPKNoFilter怎么用?PHP entryPeer::retrieveByPKNoFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entryPeer的用法示例。


在下文中一共展示了entryPeer::retrieveByPKNoFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getEntry

 public function getEntry()
 {
     if ($this->aEntry == null && $this->getEntryId()) {
         $this->aEntry = entryPeer::retrieveByPKNoFilter($this->getEntryId());
     }
     return $this->aEntry;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:7,代码来源:BulkUploadResult.php

示例2: objectUpdated

 public function objectUpdated(BaseObject $object, BatchJob $raisedJob = null)
 {
     $entry = entryPeer::retrieveByPKNoFilter($object->getEntryId());
     if ($entry) {
         $entry->setUpdatedAt(time());
         $entry->save();
     }
     return true;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:9,代码来源:kContentDistributionFlowManager.php

示例3: getEntry

 /**
  * @return entry
  */
 protected function getEntry()
 {
     $entryId = $this->getEntryId();
     $entry = entryPeer::getInstanceFromPool($entryId);
     if (!$entry) {
         $entry = entryPeer::retrieveByPKNoFilter($entryId);
     }
     return $entry;
 }
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:EntryDistribution.php

示例4: calculateId

 private static function calculateId()
 {
     $dc = kDataCenterMgr::getCurrentDc();
     for ($i = 0; $i < 10; ++$i) {
         $id = $dc["id"] . '_' . kString::generateStringId();
         $existing_object = entryPeer::retrieveByPKNoFilter($id);
         if (!$existing_object) {
             return $id;
         }
     }
     die;
 }
开发者ID:AdiTal,项目名称:server,代码行数:12,代码来源:syndicationFeed.php

示例5: execute

 public function execute()
 {
     $entry_id = $this->getRequestParameter("entryId");
     // workaround the filter which hides all the deleted entries -
     // now that deleted entries are part of xmls (they simply point to the 'deleted' templates), we should allow them here
     $entry = entryPeer::retrieveByPKNoFilter($entry_id);
     if (!$entry) {
         KExternalErrors::dieError(KExternalErrors::ENTRY_NOT_FOUND);
     }
     if ($entry->getType() != entryType::LIVE_STREAM || $entry->getStatus() == entryStatus::DELETED) {
         // because the fiter was turned off - a manual check for deleted entries must be done.
         die;
     }
     $file = $entry->getStreamName();
     $streamer = $entry->getStreamUrl();
     $this->logMessage("streamclipper: serving entry [{$entry_id}] file[{$file}] streamer[{$streamer}]", "warning");
     $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<config>\n\t<file>{$file}</file>\n\t<subscribe>true</subscribe>\n\t<streamer>{$streamer}</streamer>\n\t<type>fcsubscribe</type>\n</config>";
     header("Content-Type: text/xml; charset=UTF-8");
     echo $xml;
     die;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:21,代码来源:streamclipperAction.class.php

示例6: execute

 public function execute()
 {
     $this->entryId = $this->getRequestParameter("entryId", null);
     $this->flavorId = $this->getRequestParameter("flavorId", null);
     $this->storageId = $this->getRequestParameter("storageId", null);
     $this->maxBitrate = $this->getRequestParameter("maxBitrate", null);
     $flavorIdsStr = $this->getRequestParameter("flavorIds", null);
     if ($flavorIdsStr) {
         $this->flavorIds = explode(",", $flavorIdsStr);
     }
     $this->entry = entryPeer::retrieveByPKNoFilter($this->entryId);
     if (!$this->entry) {
         KExternalErrors::dieError(KExternalErrors::ENTRY_NOT_FOUND);
     }
     if (!$this->flavorId) {
         $flavorParamId = $this->getRequestParameter("flavorParamId", null);
         if ($flavorParamId) {
             $flavorAsset = flavorAssetPeer::retrieveByEntryIdAndFlavorParams($entry->getId(), $flavorParamId);
             if (!$flavorAsset) {
                 KExternalErrors::dieError(KExternalErrors::FLAVOR_NOT_FOUND);
             }
             $this->flavorId = $flavorAsset->getId();
         }
     }
     $this->validateStorageId();
     $this->protocol = $this->getRequestParameter("protocol", null);
     if (!$this->protocol) {
         $this->protocol = StorageProfile::PLAY_FORMAT_HTTP;
     }
     $this->format = $this->getRequestParameter("format");
     if (!$this->format) {
         $this->format = StorageProfile::PLAY_FORMAT_HTTP;
     }
     $this->cdnHost = $this->getRequestParameter("cdnHost", null);
     $partner = $this->entry->getPartner();
     if (!$this->cdnHost || $partner->getForceCdnHost()) {
         $this->cdnHost = myPartnerUtils::getCdnHost($this->entry->getPartnerId(), $this->protocol);
     }
     if ($this->maxBitrate && (!is_numeric($this->maxBitrate) || $this->maxBitrate <= 0)) {
         KExternalErrors::dieError(KExternalErrors::INVALID_MAX_BITRATE);
     }
     $ksStr = $this->getRequestParameter("ks");
     $base64Referrer = $this->getRequestParameter("referrer");
     $referrer = base64_decode($base64Referrer);
     if (!is_string($referrer)) {
         $referrer = "";
     }
     // base64_decode can return binary data
     $securyEntryHelper = new KSecureEntryHelper($this->entry, $ksStr, $referrer);
     if ($securyEntryHelper->shouldPreview()) {
         $this->clipTo = $securyEntryHelper->getPreviewLength() * 1000;
     } else {
         $securyEntryHelper->validateForPlay($this->entry, $ksStr);
     }
     // grab seekFrom parameter and normalize url
     $this->seekFrom = $this->getRequestParameter("seekFrom", -1);
     if ($this->seekFrom <= 0) {
         $this->seekFrom = -1;
     }
     if ($this->entry->getStatus() == entryStatus::DELETED) {
         // because the fiter was turned off - a manual check for deleted entries must be done.
         die;
     }
     $xml = null;
     switch ($this->format) {
         case StorageProfile::PLAY_FORMAT_HTTP:
             $xml = $this->serveHttp();
             break;
         case StorageProfile::PLAY_FORMAT_RTMP:
             $xml = $this->serveRtmp();
             break;
         case StorageProfile::PLAY_FORMAT_SILVER_LIGHT:
             $xml = $this->serveSilverLight();
             break;
         case StorageProfile::PLAY_FORMAT_APPLE_HTTP:
             $xml = $this->serveAppleHttp();
             break;
         case "url":
             return $this->serveUrl();
             break;
         case "hdnetworksmil":
             $xml = $this->serveHDNetwork();
             break;
         case "hdnetwork":
             $duration = $this->entry->getDurationInt();
             $mediaUrl = "<media url=\"" . requestUtils::getHost() . str_replace("f4m", "smil", str_replace("hdnetwork", "hdnetworksmil", $_SERVER["REQUEST_URI"])) . "\"/>";
             $xml = $this->buildXml(self::PLAY_STREAM_TYPE_RECORDED, array(), 'video/x-flv', $duration, null, $mediaUrl);
             break;
     }
     if ($this->format == StorageProfile::PLAY_FORMAT_APPLE_HTTP) {
         header("Content-Type: text/plain; charset=UTF-8");
     } else {
         header("Content-Type: text/xml; charset=UTF-8");
         header("Content-Disposition: inline; filename=manifest.xml");
     }
     echo $xml;
     die;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:98,代码来源:playManifestAction.class.php

示例7: attachOperationResource

 /**
  * @param kOperationResource $resource
  * @param entry $dbEntry
  * @param asset $dbAsset
  * @return asset
  */
 protected function attachOperationResource(kOperationResource $resource, entry $dbEntry, asset $dbAsset = null)
 {
     $isNewAsset = false;
     $isSource = false;
     if ($dbAsset) {
         if ($dbAsset instanceof flavorAsset) {
             $isSource = $dbAsset->getIsOriginal();
         }
     } else {
         $isNewAsset = true;
         $isSource = true;
         KalturaLog::debug("Creating original flavor asset");
         $dbAsset = kFlowHelper::createOriginalFlavorAsset($this->getPartnerId(), $dbEntry->getId());
     }
     if (!$dbAsset && $dbEntry->getStatus() == entryStatus::NO_CONTENT) {
         $dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
         $dbEntry->save();
     }
     $operationAttributes = $resource->getOperationAttributes();
     $internalResource = $resource->getResource();
     if ($internalResource instanceof kLiveEntryResource) {
         $dbEntry->setOperationAttributes($operationAttributes);
         $dbEntry->save();
         return $this->attachLiveEntryResource($internalResource, $dbEntry, $dbAsset, $operationAttributes);
     }
     $dbAsset = $this->attachResource($internalResource, $dbEntry, $dbAsset);
     $sourceType = $resource->getSourceType();
     if ($sourceType) {
         $dbEntry->setSource($sourceType);
         $dbEntry->save();
     }
     $errDescription = '';
     kBusinessPreConvertDL::decideAddEntryFlavor(null, $dbEntry->getId(), $resource->getAssetParamsId(), $errDescription, $dbAsset->getId(), $operationAttributes);
     if ($isNewAsset) {
         kEventsManager::raiseEvent(new kObjectAddedEvent($dbAsset));
     }
     kEventsManager::raiseEvent(new kObjectDataChangedEvent($dbAsset));
     if ($isSource && $internalResource instanceof kFileSyncResource) {
         $srcEntryId = $internalResource->getEntryId();
         if ($srcEntryId) {
             $srcEntry = entryPeer::retrieveByPKNoFilter($srcEntryId);
             if ($srcEntry) {
                 $dbEntry->setSourceEntryId($srcEntryId);
                 $dbEntry->setRootEntryId($srcEntry->getRootEntryId(true));
             }
         }
         $dbEntry->setOperationAttributes($operationAttributes);
         $dbEntry->save();
     }
     return $dbAsset;
 }
开发者ID:AdiTal,项目名称:server,代码行数:57,代码来源:KalturaEntryService.php

示例8: generateFilePathArr

 /**
  * (non-PHPdoc)
  * @see lib/model/ISyncableFile#generateFilePathArr()
  */
 public function generateFilePathArr($sub_type, $version = null)
 {
     static::validateFileSyncSubType($sub_type);
     $version = is_null($version) ? $this->getVersionForSubType($sub_type) : $version;
     $entry = entryPeer::retrieveByPKNoFilter($this->getEntryId());
     if (!$entry) {
         throw new Exception("Could not find entry [" . $this->getEntryId() . "] for asset [" . $this->getId() . "]");
     }
     $dir = intval($entry->getIntId() / 1000000) . '/' . intval($entry->getIntId() / 1000) % 1000;
     $path = "/content/entry/data/{$dir}/" . $this->generateFileName($sub_type, $version);
     return array(myContentStorage::getFSContentRootPath(), $path);
 }
开发者ID:DBezemer,项目名称:server,代码行数:16,代码来源:asset.php

示例9: addJob

 /**
  * @param BatchJob $batchJob
  * @param $data
  * @param int $type
  * @param int $subType
  * @return BatchJob
  */
 public static function addJob(BatchJob $batchJob, kJobData $data, $type, $subType = null)
 {
     $batchJob->setJobType($type);
     $batchJob->setJobSubType($subType);
     $batchJob->setData($data);
     if (!$batchJob->getParentJobId() && $batchJob->getEntryId()) {
         $currentJob = kBatchManager::getCurrentUpdatingJob();
         if ($currentJob && $currentJob->getEntryId() == $batchJob->getEntryId()) {
             $batchJob->setParentJobId($currentJob->getId());
             $batchJob->setBulkJobId($currentJob->getBulkJobId());
             $batchJob->setRootJobId($currentJob->getRootJobId());
         } else {
             $entry = entryPeer::retrieveByPKNoFilter($batchJob->getEntryId());
             // some jobs could be on deleted entry
             if ($entry) {
                 $batchJob->setRootJobId($entry->getBulkUploadId());
                 $batchJob->setBulkJobId($entry->getBulkUploadId());
             }
         }
     }
     $lockInfo = new kLockInfoData($batchJob);
     $lockInfo->setEstimatedEffort($data->calculateEstimatedEffort($batchJob));
     $lockInfo->setPriority($data->calculatePriority($batchJob));
     $lockInfo->setUrgency($data->calculateUrgency($batchJob));
     $batchJob->setLockInfo($lockInfo);
     if (is_null($batchJob->getStatus())) {
         $batchJob = self::updateBatchJob($batchJob, BatchJob::BATCHJOB_STATUS_PENDING);
     } else {
         $batchJob = self::updateBatchJob($batchJob, $batchJob->getStatus());
     }
     return $batchJob;
 }
开发者ID:ace3535,项目名称:server,代码行数:39,代码来源:kJobsManager.php

示例10: updatedVirusScanFailed

 protected function updatedVirusScanFailed(BatchJob $dbBatchJob, kVirusScanJobData $data)
 {
     $entry = entryPeer::retrieveByPKNoFilter($dbBatchJob->getEntryId());
     if ($entry) {
         self::setEntryStatusBeforeScanFailure($entry, $entry->getStatus());
         $entry->setStatus(VirusScanPlugin::getEntryStatusCoreValue(VirusScanEntryStatus::SCAN_FAILURE));
         $entry->save();
         myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE, $entry);
     } else {
         KalturaLog::err('Entry not found with id [' . $dbBatchJob->getEntryId() . ']');
         throw new Exception('Entry not found with id [' . $dbBatchJob->getEntryId() . ']');
     }
     $flavorAsset = assetPeer::retrieveById($data->getFlavorAssetId());
     if ($flavorAsset) {
         self::setFlavorAssetStatusBeforeScanFailure($flavorAsset, $flavorAsset->getStatus());
         $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
         $flavorAsset->save();
     } else {
         KalturaLog::err('Flavor asset not found with id [' . $data->getFlavorAssetId() . ']');
         throw new Exception('Flavor asset not found with id [' . $data->getFlavorAssetId() . ']');
     }
     // do not resume flavor asset added event consumption
     return $dbBatchJob;
 }
开发者ID:DBezemer,项目名称:server,代码行数:24,代码来源:kVirusScanFlowManager.php

示例11: getEntry

 /**
  * 
  * @param $getDeleted
  * @param $enableCache
  * 
  * @return entry
  */
 public function getEntry($getDeleted = false, $enableCache = true)
 {
     if (!$enableCache) {
         $this->aEntry = null;
         entryPeer::clearInstancePool();
     }
     if ($this->aEntry == null && $this->getEntryId()) {
         if ($getDeleted) {
             $this->aEntry = entryPeer::retrieveByPKNoFilter($this->getEntryId());
         } else {
             $this->aEntry = entryPeer::retrieveByPK($this->getEntryId());
         }
     }
     return $this->aEntry;
 }
开发者ID:DBezemer,项目名称:server,代码行数:22,代码来源:BatchJob.php

示例12: getFieldValuesXml

 protected function getFieldValuesXml(EntryDistribution $entryDistribution, $fieldName = null)
 {
     $entry = entryPeer::retrieveByPKNoFilter($entryDistribution->getEntryId());
     if (!$entry) {
         KalturaLog::err('Entry not found with ID [' . $entryDistribution->getEntryId() . ']');
         return null;
     }
     // set the default criteria to use the current entry distribution partner id (it is restored later)
     // this is needed for related entries under kMetadataMrssManager which is using retrieveByPK without the correct partner id filter
     $oldEntryCriteria = entryPeer::getCriteriaFilter()->getFilter();
     myPartnerUtils::resetPartnerFilter('entry');
     myPartnerUtils::addPartnerToCriteria('entry', $entryDistribution->getPartnerId(), true);
     try {
         $mrss = null;
         $mrssParams = new kMrssParameters();
         if ($this->getItemXpathsToExtend()) {
             $mrssParams->setItemXpathsToExtend($this->getItemXpathsToExtend());
         }
         $mrss = kMrssManager::getEntryMrssXml($entry, $mrss, $mrssParams);
         $mrssStr = $mrss->asXML();
     } catch (Exception $e) {
         // restore the original criteria so it will not get stuck due to the exception
         entryPeer::getCriteriaFilter()->setFilter($oldEntryCriteria);
         throw $e;
     }
     // restore the original criteria
     entryPeer::getCriteriaFilter()->setFilter($oldEntryCriteria);
     if (!$mrssStr) {
         KalturaLog::err('No MRSS returned for entry [' . $entry->getId() . ']');
         return null;
     }
     $mrssObj = new DOMDocument();
     if (!$mrssObj->loadXML($mrssStr)) {
         KalturaLog::err('Error loading MRSS XML object for entry [' . $entry->getId() . ']');
         return null;
     }
     $xslObj = new DOMDocument();
     $xslStr = $this->getFieldValuesXslt($entryDistribution, $fieldName);
     $xslStr = trim($xslStr);
     if (!$xslObj->loadXML($xslStr)) {
         KalturaLog::err('Error loading distribution profile XSLT for profile ID [' . $this->getId() . ']');
         return null;
     }
     $proc = new XSLTProcessor();
     $proc->registerPHPFunctions(kXml::getXslEnabledPhpFunctions());
     $proc->importStyleSheet($xslObj);
     $resultXml = $proc->transformToXml($mrssObj);
     //in order to keep the UTF-8 encoding we transformToXml http://www.php.net/manual/en/xsltprocessor.transformtodoc.php#69305
     $resultXmlObj = new DOMDocument();
     $resultXmlObj->loadXML($resultXml);
     if (!$resultXmlObj) {
         KalturaLog::err('Error transforming XML for distribution profile [' . $this->getId() . '] and entry id [' . $entry->getId() . ']');
         return null;
     }
     /* DEBUG logs
     		KalturaLog::log('entry mrss = '.$mrssStr);
     		KalturaLog::log('profile xslt = '.$xslStr);
     		*/
     KalturaLog::debug('Result XML: ' . $resultXmlObj->saveXML());
     return $resultXmlObj;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:61,代码来源:ConfigurableDistributionProfile.php

示例13: flagEntry

 protected function flagEntry(KalturaModerationFlag $moderationFlag, $entryType = null)
 {
     $moderationFlag->validatePropertyNotNull("flaggedEntryId");
     $entryId = $moderationFlag->flaggedEntryId;
     $dbEntry = entryPeer::retrieveByPKNoFilter($entryId);
     if (!$dbEntry || $entryType !== null && $dbEntry->getType() != $entryType) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $validModerationStatuses = array(KalturaEntryModerationStatus::APPROVED, KalturaEntryModerationStatus::AUTO_APPROVED, KalturaEntryModerationStatus::FLAGGED_FOR_REVIEW);
     if (!in_array($dbEntry->getModerationStatus(), $validModerationStatuses)) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_CANNOT_BE_FLAGGED);
     }
     $dbModerationFlag = new moderationFlag();
     $dbModerationFlag->setPartnerId($dbEntry->getPartnerId());
     $dbModerationFlag->setKuserId($this->getKuser()->getId());
     $dbModerationFlag->setFlaggedEntryId($dbEntry->getId());
     $dbModerationFlag->setObjectType(KalturaModerationObjectType::ENTRY);
     $dbModerationFlag->setStatus(KalturaModerationFlagStatus::PENDING);
     $dbModerationFlag->setFlagType($moderationFlag->flagType);
     $dbModerationFlag->setComments($moderationFlag->comments);
     $dbModerationFlag->save();
     $dbEntry->setModerationStatus(KalturaEntryModerationStatus::FLAGGED_FOR_REVIEW);
     $dbEntry->incModerationCount();
     $dbEntry->save();
     $moderationFlag = new KalturaModerationFlag();
     $moderationFlag->fromObject($dbModerationFlag);
     // need to notify the partner that an entry was flagged - use the OLD moderation onject that is required for the
     // NOTIFICATION_TYPE_ENTRY_REPORT notification
     // TODO - change to moderationFlag object to implement the interface for the notification:
     // it should have "objectId", "comments" , "reportCode" as getters
     $oldModerationObj = new moderation();
     $oldModerationObj->setPartnerId($dbEntry->getPartnerId());
     $oldModerationObj->setComments($moderationFlag->comments);
     $oldModerationObj->setObjectId($dbEntry->getId());
     $oldModerationObj->setObjectType(moderation::MODERATION_OBJECT_TYPE_ENTRY);
     $oldModerationObj->setReportCode("");
     myNotificationMgr::createNotification(notification::NOTIFICATION_TYPE_ENTRY_REPORT, $oldModerationObj, $dbEntry->getPartnerId());
     return $moderationFlag;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:39,代码来源:KalturaEntryService.php

示例14: addJob

 /**
  * @param BatchJob $batchJob
  * @param $data
  * @param int $type
  * @param int $subType
  * @return BatchJob
  */
 public static function addJob(BatchJob $batchJob, $data, $type, $subType = null)
 {
     $batchJob->setJobType($type);
     $batchJob->setJobSubType($subType);
     $batchJob->setData($data);
     if (!$batchJob->getParentJobId() && $batchJob->getEntryId()) {
         $currentJob = kBatchManager::getCurrentUpdatingJob();
         if ($currentJob && $currentJob->getEntryId() == $batchJob->getEntryId()) {
             $batchJob->setParentJobId($currentJob->getId());
             $batchJob->setBulkJobId($currentJob->getBulkJobId());
             $batchJob->setRootJobId($currentJob->getRootJobId());
         } else {
             $entry = entryPeer::retrieveByPKNoFilter($batchJob->getEntryId());
             // some jobs could be on deleted entry
             if ($entry) {
                 $batchJob->setRootJobId($entry->getBulkUploadId());
                 $batchJob->setBulkJobId($entry->getBulkUploadId());
             }
         }
     }
     // validate partner id
     $partnerId = $batchJob->getPartnerId();
     //		if(!$partnerId)
     //			throw new APIException(APIErrors::PARTNER_NOT_SET);
     // validate that partner exists
     $partner = PartnerPeer::retrieveByPK($partnerId);
     if (!$partner) {
         KalturaLog::err("Invalid partner id [{$partnerId}]");
         throw new APIException(APIErrors::INVALID_PARTNER_ID, $partnerId);
     }
     // set the priority and work group
     $batchJob->setPriority($partner->getPriority($batchJob->getBulkJobId()));
     $batchJob = self::updateBatchJob($batchJob, BatchJob::BATCHJOB_STATUS_PENDING);
     // look for identical jobs
     $twinJobs = BatchJobPeer::retrieveDuplicated($type, $data);
     $twinJob = null;
     if (count($twinJobs)) {
         foreach ($twinJobs as $currentTwinJob) {
             if ($currentTwinJob->getId() != $batchJob->getId()) {
                 $twinJob = reset($twinJobs);
             }
         }
     }
     if (!is_null($twinJob)) {
         $batchJob->setTwinJobId($twinJob->getId());
         if (!kConf::get("batch_ignore_duplication")) {
             $batchJob = self::updateBatchJob($batchJob, $twinJob->getStatus(), $twinJob);
         } else {
             $batchJob->save();
         }
     }
     return $batchJob;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:60,代码来源:kJobsManager.php

示例15: restoreDeletedEntryAction

 /**
  * Restore deleted entry.
  *
  * @action restoreDeletedEntry
  * @param string $entryId
  * @return KalturaBaseEntry The restored entry
  */
 public function restoreDeletedEntryAction($entryId)
 {
     $deletedEntry = entryPeer::retrieveByPKNoFilter($entryId);
     if (!$deletedEntry) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $fileSyncKeys = array();
     foreach (self::$fileSyncKeysToRestore as $key) {
         $fileSyncKeys[] = $deletedEntry->getSyncKey($key);
     }
     $c = new Criteria();
     $c->add(assetPeer::ENTRY_ID, $entryId, Criteria::EQUAL);
     assetPeer::setUseCriteriaFilter(false);
     $deletedAssets = assetPeer::doSelect($c);
     assetPeer::setUseCriteriaFilter(true);
     foreach ($deletedAssets as $deletedAsset) {
         array_push($fileSyncKeys, $deletedAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET), $deletedAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_CONVERT_LOG));
     }
     $fileSyncs = array();
     FileSyncPeer::setUseCriteriaFilter(false);
     foreach ($fileSyncKeys as $fileSyncKey) {
         $fileSyncs = array_merge($fileSyncs, FileSyncPeer::retrieveAllByFileSyncKey($fileSyncKey));
     }
     FileSyncPeer::setUseCriteriaFilter(true);
     if (!$this->validateEntryForRestoreDelete($deletedEntry, $fileSyncs, $deletedAssets)) {
         throw new KalturaAPIException(KalturaAdminConsoleErrors::ENTRY_ASSETS_WRONG_STATUS_FOR_RESTORE, $entryId);
     }
     $this->restoreFileSyncs($fileSyncs);
     //restore assets
     foreach ($deletedAssets as $deletedAsset) {
         $deletedAsset->setStatus(asset::ASSET_STATUS_READY);
         $deletedAsset->save();
     }
     //restore entry
     $deletedEntry->setStatusReady();
     $deletedEntry->setThumbnail($deletedEntry->getFromCustomData("deleted_original_thumb"), true);
     $deletedEntry->setData($deletedEntry->getFromCustomData("deleted_original_data"), true);
     //data should be resotred even if it's NULL
     $deletedEntry->save();
     kEventsManager::flushEvents();
     kMemoryManager::clearMemory();
     $entry = KalturaEntryFactory::getInstanceByType($deletedEntry->getType(), true);
     $entry->fromObject($deletedEntry, $this->getResponseProfile());
     return $entry;
 }
开发者ID:dozernz,项目名称:server,代码行数:52,代码来源:EntryAdminService.php


注:本文中的entryPeer::retrieveByPKNoFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。