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


PHP entry::setKuserId方法代码示例

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


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

示例1: postInsert

 public function postInsert(PropelPDO $con = null)
 {
     parent::postInsert($con);
     if (!$this->getFeedId() || !$this->getId()) {
         return;
     }
     $syndicationFeed = syndicationFeedPeer::retrieveByPK($this->getFeedId());
     if (!$syndicationFeed || !$syndicationFeed instanceof genericSyndicationFeed) {
         return;
     }
     // "Creates advanced filter on distribution profile
     $distributionAdvancedSearch = new ContentDistributionSearchFilter();
     $distributionAdvancedSearch->setDistributionProfileId($this->getId());
     $distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
     $distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
     $distributionAdvancedSearch->setEntryDistributionFlag(EntryDistributionDirtyStatus::NONE);
     //Creates entry filter with advanced filter
     $entryFilter = new entryFilter();
     $entryFilter->setPartnerIdEquel($this->getPartnerId());
     $entryFilter->setAdvancedSearch($distributionAdvancedSearch);
     // Creates playlist with entry filter
     $playlistXml = new SimpleXMLElement("<playlist/>");
     $filtersXml = $playlistXml->addChild("filters");
     $filterXml = $filtersXml->addChild("filter");
     $entryFilter->toXml($filterXml);
     $playlistContent = $playlistXml->asXML();
     // creates playlist based on the filter XML
     $playlist = new entry();
     $playlist->setKuserId(kCurrentContext::$uid);
     $playlist->setCreatorKuserId(kCurrentContext::$uid);
     $playlist->setDisplayInSearch(mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM);
     $playlist->setPartnerId($this->getPartnerId());
     $playlist->setStatus(entryStatus::READY);
     $playlist->setKshowId(null);
     $playlist->setType(entryType::PLAYLIST);
     $playlist->setMediaType(entry::ENTRY_MEDIA_TYPE_XML);
     $playlist->setDataContent($playlistContent);
     $playlist->save();
     KalturaLog::log("Playlist [" . $playlist->getId() . "] created");
     // creates feed based on the playlist
     $syndicationFeed->setPlaylistId($playlist->getId());
     $syndicationFeed->save();
 }
开发者ID:DBezemer,项目名称:server,代码行数:43,代码来源:SyndicationDistributionProfile.php

示例2: createEntry

 /**
  * This helps create special entries in a kshow - the show_entry & intro
  * $type can be either entry::ENTRY_MEDIA_TYPE_SHOW (for the show_entry) or  entry::ENTRY_MEDIA_TYPE_VIDEO  (for the intro)
  */
 public function createEntry($type, $kuser_id, $thumbnail = null, $entry_name = null)
 {
     // for invites we use the default invites from the kaltura gallery show
     if ($type != entry::ENTRY_MEDIA_TYPE_SHOW) {
         $kshow_type = $this->getType();
         $intros = array(kshow::KSHOW_TYPE_MASHUP, kshow::KSHOW_TYPE_MUSIC_VIDEO, kshow::KSHOW_TYPE_HOWTO, kshow::KSHOW_TYPE_CALL_FOR_ACTION, kshow::KSHOW_TYPE_CONTEST, kshow::KSHOW_TYPE_GROUP_GREETING, kshow::KSHOW_TYPE_SPORTS, kshow::KSHOW_TYPE_DIGITAL_STORY, kshow::KSHOW_TYPE_GROUP_TRAVELOGUE);
         $id = 0;
         if (in_array($kshow_type, $intros)) {
             $id = $kshow_type;
         }
         $id = 120 + $id;
         $entry = entryPeer::retrieveByPK($id);
         if ($entry) {
             $this->setIntroId($entry->getId());
             $this->m_intro = $entry;
         }
         return $entry;
     }
     $kshow = $this;
     $entry = new entry();
     $entry->setKshowId($kshow->getId());
     $entry->setKuserId($kuser_id);
     $entry->setCreatorKuserId($kuser_id);
     if ($this->getPartnerId() !== null) {
         $entry->setPartnerId($this->getPartnerId());
     }
     // inherit partner_id from kshow
     if ($this->getSubpId() !== null) {
         $entry->setSubpId($this->getSubpId());
     }
     // inherit subp_id from kshow
     $entry->setStatus(entryStatus::READY);
     if ($entry_name) {
         $type_text = $entry_name;
     } else {
         $type_text = "Kaltura Video";
     }
     //$entry->setData ( "&kal_show.flv");
     $entry->setThumbnail($thumbnail ? $thumbnail : "&kal_show.jpg");
     $entry->setCreateThumb(false);
     $entry->setType(entryType::MIX);
     $entry->setMediaType(entry::ENTRY_MEDIA_TYPE_SHOW);
     $entry->setEditorType(myMetadataUtils::METADATA_EDITOR_SIMPLE);
     $entry->setName($type_text);
     $entry->setTags($type_text . "," . $kshow->getTags());
     $entry->save();
     $this->setShowEntryId($entry->getId());
     $this->m_show_entry = $entry;
     return $entry;
 }
开发者ID:DBezemer,项目名称:server,代码行数:54,代码来源:kshow.php

示例3: checkAndSetValidUserUpdate

 /**
  * Sets the valid user for the entry 
  * Throws an error if the session user is trying to update entry to another user and not using an admin session 
  *
  * @param KalturaBaseEntry $entry
  * @param entry $dbEntry
  */
 protected function checkAndSetValidUserUpdate(KalturaBaseEntry $entry, entry $dbEntry)
 {
     KalturaLog::debug("DB puser id [" . $dbEntry->getPuserId() . "] kuser id [" . $dbEntry->getKuserId() . "]");
     // user id not being changed
     if ($entry->userId === null) {
         KalturaLog::log("entry->userId is null, not changing user");
         return;
     }
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         $entryPuserId = $dbEntry->getPuserId();
         // non admin cannot change the owner of an existing entry
         if (strtolower($entry->userId) != strtolower($entryPuserId)) {
             KalturaLog::debug('API entry userId [' . $entry->userId . '], DB entry userId [' . $entryPuserId . '] - change required but KS is not admin');
             throw new KalturaAPIException(KalturaErrors::INVALID_KS, "", ks::INVALID_TYPE, ks::getErrorStr(ks::INVALID_TYPE));
         }
     }
     // need to create kuser if this is an admin changing the owner of the entry to a different user
     $kuser = kuserPeer::createKuserForPartner($dbEntry->getPartnerId(), $entry->userId);
     KalturaLog::debug("Set kuser id [" . $kuser->getId() . "] line [" . __LINE__ . "]");
     $dbEntry->setKuserId($kuser->getId());
 }
开发者ID:DBezemer,项目名称:server,代码行数:28,代码来源:KalturaEntryService.php

示例4: handleEntry


//.........这里部分代码省略.........
                     $importedThumbPath = $uploads . $entry_data_prefix . '_temp_thumb' . strrchr($entry_thumbUrl, '.');
                     if (kFile::downloadUrlToFile($entry_thumbUrl, $importedThumbPath)) {
                         myFileConverter::createImageThumbnail($importedThumbPath, $thumbFullPath, "image2");
                         // set thumb as big thumb so fileSync will be created.
                         $thumbBigFullPath = $thumbFullPath;
                     } else {
                         $need_thumb = false;
                     }
                 } else {
                     if ($entry_thumbNum == 0) {
                         $entry_thumbNum = 1;
                         $thumbTime = 3;
                         if ($duration && $duration < $thumbTime * 1000) {
                             $thumbTime = floor($duration / 1000);
                         }
                         // for videos - thumbail should be created in post convert
                         // otherwise this code will fail if the thumbanil wasn't created successfully (roman)
                         //myFileConverter::autoCaptureFrame($entry_fullPath, $thumbTempPrefix."big_", $thumbTime, -1, -1);
                         $need_thumb = false;
                         $thumbBigFullPath = $thumbTempPrefix . "big_" . $entry_thumbNum . '.jpg';
                     }
                 }
                 //else select existing thumb ($entry_thumbNum already points to the right thumbnail)
             }
         }
         $thumbFullPath = $thumbTempPrefix . $entry_thumbNum . '.jpg';
         // if we arrived here both entry and thumbnail are valid we can now update the db
         // in order to have the final entry_id and move its data to its final destination
         if ($onlyExtractThumb) {
             return $thumbFullPath;
         }
     }
     $entry->setkshowId($this->kshow_id);
     $entry->setKuserId($kuser_id);
     $entry->setCreatorKuserId($kuser_id);
     if ($this->partner_id != null) {
         $entry->setPartnerId($this->partner_id);
         $entry->setSubpId($this->subp_id);
     }
     $entry->setName($name ? $name : $this->getParam('entry_name'));
     //		$entry->setDescription('');//$this->getParam('entry_description'));
     $entry->setType($type);
     $entry->setMediaType($media_type);
     $entry->setTags($tags ? $tags : $this->getParam('entry_tags'));
     $entry->setSource($media_source);
     $entry->setSourceId($this->getParam('entry_media_id'));
     if ($media_date) {
         $entry->setMediaDate($media_date);
     }
     // if source_link wasnt given use the entry_url HOWEVER, use it only if id doesnt contain @ which suggests the use of a password
     $entry->setSourceLink($entry_source_link ? $entry_source_link : (strstr($entry_url, '@') ? "" : $entry_url));
     if ($media_source == entry::ENTRY_MEDIA_SOURCE_FILE) {
         $entry->setSourceLink("file:{$entry_fullPath}");
     }
     $entry->setLicenseType($this->getParam('entry_license'));
     $entry->setCredit($this->getParam('entry_credit'));
     $entry->setStatus($entry_status);
     if ($duration !== null) {
         $entry->setLengthInMsecs($duration);
     }
     if ($this->entry_id == 0) {
         $entry->save();
         $this->entry_id = $entry->getId();
     }
     // move thumb to final destination and set db entry
     if ($media_type != entry::ENTRY_MEDIA_TYPE_AUDIO && $entry_thumbNum && $need_thumb) {
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:67,代码来源:myInsertEntryHelper.class.php

示例5: createFriendsMakeover

 public static function createFriendsMakeover($subp_id, $puser_id, $puser_ids)
 {
     list($kshow_id, $roughcut_entry) = self::getFriendsMakover($subp_id, $puser_id);
     if (!$kshow_id) {
         return array(0, 0, 0);
     }
     $kshow = kshowPeer::retrieveByPK($kshow_id);
     if (!$roughcut_entry) {
         $roughcut_entry = new entry();
         $roughcut_entry->setKshowId($kshow->getId());
         $roughcut_entry->setKuserId($kshow->getProducerId());
         $roughcut_entry->setCreatorKuserId($kshow->getProducerId());
         $roughcut_entry->setPartnerId($kshow->getPartnerId());
         $roughcut_entry->setSubpId($kshow->getSubpId());
         $roughcut_entry->setStatus(entryStatus::READY);
         $roughcut_entry->setThumbnail("&kal_show.jpg");
         $roughcut_entry->setType(entryType::MIX);
         $roughcut_entry->setMediaType(entry::ENTRY_MEDIA_TYPE_SHOW);
         $roughcut_entry->setName("Kaltura Video");
         $roughcut_entry->setTags("");
         $roughcut_entry->save();
     }
     list($entry_ids, $entry_puser_ids) = self::getMakeoverEntries($subp_id, $puser_id, $puser_ids);
     $custom_data = implode(",", $entry_puser_ids);
     if ($roughcut_entry->getFromCustomData("facelift", $subp_id) == $custom_data) {
         // if the users list didnt change use the current roughcut
         return array($kshow_id, $roughcut_entry->getId(), 0);
     }
     $c = new Criteria();
     $c->add(entryPeer::ID, $entry_ids, Criteria::IN);
     $entries = entryPeer::doSelect($c);
     self::createKEditorMetadata($kshow, $roughcut_entry, $entries);
     $roughcut_entry->putInCustomData("facelift", $custom_data, $subp_id);
     $roughcut_entry->save();
     return array($kshow_id, $roughcut_entry->getId(), 1);
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:facebookUtils.class.php

示例6: createRecordedEntry

 /**
  * @param LiveEntry $dbEntry
  * @return entry
  */
 private function createRecordedEntry(LiveEntry $dbEntry, $mediaServerIndex)
 {
     $lock = kLock::create("live_record_" . $dbEntry->getId());
     if ($lock && !$lock->lock(self::KLOCK_CREATE_RECORDED_ENTRY_GRAB_TIMEOUT, self::KLOCK_CREATE_RECORDED_ENTRY_HOLD_TIMEOUT)) {
         return;
     }
     // If while we were waiting for the lock, someone has updated the recorded entry id - we should use it.
     $dbEntry->reload();
     if ($dbEntry->getRecordStatus() != RecordStatus::PER_SESSION && $dbEntry->getRecordedEntryId()) {
         $lock->unlock();
         $recordedEntry = entryPeer::retrieveByPK($dbEntry->getRecordedEntryId());
         return $recordedEntry;
     }
     $recordedEntry = null;
     try {
         $recordedEntryName = $dbEntry->getName();
         if ($dbEntry->getRecordStatus() == RecordStatus::PER_SESSION) {
             $recordedEntryName .= ' ' . ($dbEntry->getRecordedEntryIndex() + 1);
         }
         $recordedEntry = new entry();
         $recordedEntry->setType(entryType::MEDIA_CLIP);
         $recordedEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_VIDEO);
         $recordedEntry->setRootEntryId($dbEntry->getId());
         $recordedEntry->setName($recordedEntryName);
         $recordedEntry->setDescription($dbEntry->getDescription());
         $recordedEntry->setSourceType(EntrySourceType::RECORDED_LIVE);
         $recordedEntry->setAccessControlId($dbEntry->getAccessControlId());
         $recordedEntry->setConversionProfileId($dbEntry->getConversionProfileId());
         $recordedEntry->setKuserId($dbEntry->getKuserId());
         $recordedEntry->setPartnerId($dbEntry->getPartnerId());
         $recordedEntry->setModerationStatus($dbEntry->getModerationStatus());
         $recordedEntry->setIsRecordedEntry(true);
         $recordedEntry->setTags($dbEntry->getTags());
         $recordedEntry->save();
         $dbEntry->setRecordedEntryId($recordedEntry->getId());
         $dbEntry->save();
         $assets = assetPeer::retrieveByEntryId($dbEntry->getId(), array(assetType::LIVE));
         foreach ($assets as $asset) {
             /* @var $asset liveAsset */
             $asset->incLiveSegmentVersion($mediaServerIndex);
             $asset->save();
         }
     } catch (Exception $e) {
         $lock->unlock();
         throw $e;
     }
     $lock->unlock();
     return $recordedEntry;
 }
开发者ID:DBezemer,项目名称:server,代码行数:53,代码来源:KalturaLiveEntryService.php

示例7: checkAndSetValidUser

 /**
  * Sets the valid user for the entry 
  * Throws an error if the session user is trying to add entry to another user and not using an admin session 
  *
  * @param KalturaBaseEntry $entry
  * @param entry $dbEntry
  */
 protected function checkAndSetValidUser(KalturaBaseEntry $entry, entry $dbEntry)
 {
     KalturaLog::debug("DB puser id [" . $dbEntry->getPuserId() . "] kuser id [" . $dbEntry->getKuserId() . "]");
     // for new entry, puser ID is null - set it from service scope
     if ($dbEntry->getPuserId() === null) {
         KalturaLog::debug("Set kuser id [" . $this->getKuser()->getId() . "] line [" . __LINE__ . "]");
         $dbEntry->setKuserId($this->getKuser()->getId());
         return;
     }
     // get puser ID from entry to compare to userId on the updated entry object
     $entryPuserId = $dbEntry->getPuserId();
     $kuser = null;
     if ($dbEntry->getKuserId()) {
         // get kuser object from entry kuserId
         $kuser = kuserPeer::retrieveByPK($dbEntry->getKuserId());
         if (!$kuser || $kuser->getPuserId() != $dbEntry->getPuserId()) {
             $kuser = null;
         }
     } else {
         // get kuser object from entry puserId
         $kuser = kuserPeer::getKuserByPartnerAndUid($dbEntry->getPartnerId(), $dbEntry->getPuserId());
     }
     if ($kuser) {
         KalturaLog::debug("Set kuser id [" . $kuser->getId() . "] line [" . __LINE__ . "]");
         $dbEntry->setKuserId($kuser->getId());
         return;
     }
     // userID doesn't require change (it is null or the same as the db entry) - do nothing
     if ($entry->userId === null || $entry->userId === $entryPuserId) {
         KalturaLog::debug('API entry userId [' . $entry->userId . '], DB entry userId [' . $entryPuserId . '] - no need to change - quitting');
         return;
     }
     // db user is going to be changed, only admin allowed - otherwise, throw exception
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         KalturaLog::debug('API entry userId [' . $entry->userId . '], DB entry userId [' . $entryPuserId . '] - change required but KS is not admin');
         throw new KalturaAPIException(KalturaErrors::INVALID_KS, "", ks::INVALID_TYPE, ks::getErrorStr(ks::INVALID_TYPE));
     }
     // passed previous conditions, need to change userID on entry
     // first step is to make sure the user exists
     $puserKuser = PuserKuserPeer::createPuserKuser($this->getPartnerId(), $this->getPartnerId() * 100, $dbEntry->getPuserId(), $dbEntry->getPuserId(), $dbEntry->getPuserId(), true);
     // second step is simply changing the userID on the entry
     $dbEntry->setKuserId($puserKuser->getKuserId());
     KalturaLog::debug("Set kuser id [" . $puserKuser->getKuserId() . "] line [" . __LINE__ . "]");
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:51,代码来源:KalturaEntryService.php

示例8: getReplacingEntry

 protected static function getReplacingEntry($recordedEntry, $asset, $retries = 1)
 {
     $replacingEntryId = $recordedEntry->getReplacingEntryId();
     $replacingEntry = null;
     // in replacement
     if ($replacingEntryId) {
         $replacingEntry = entryPeer::retrieveByPKNoFilter($replacingEntryId);
         // check if asset already ingested
         $replacingAsset = assetPeer::retrieveByEntryIdAndParams($replacingEntryId, $asset->getFlavorParamsId());
         if ($replacingAsset) {
             KalturaLog::err('Asset with params [' . $asset->getFlavorParamsId() . '] already replaced');
             return null;
         }
     } else {
         $advancedOptions = new kEntryReplacementOptions();
         $advancedOptions->setKeepManualThumbnails(true);
         $recordedEntry->setReplacementOptions($advancedOptions);
         $replacingEntry = new entry();
         $replacingEntry->setType(entryType::MEDIA_CLIP);
         $replacingEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_VIDEO);
         $replacingEntry->setConversionProfileId($recordedEntry->getConversionProfileId());
         $replacingEntry->setName($recordedEntry->getPartnerId() . '_' . time());
         $replacingEntry->setKuserId($recordedEntry->getKuserId());
         $replacingEntry->setAccessControlId($recordedEntry->getAccessControlId());
         $replacingEntry->setPartnerId($recordedEntry->getPartnerId());
         $replacingEntry->setSubpId($recordedEntry->getPartnerId() * 100);
         $replacingEntry->setDefaultModerationStatus();
         $replacingEntry->setDisplayInSearch(mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM);
         $replacingEntry->setReplacedEntryId($recordedEntry->getId());
         $replacingEntry->save();
         $recordedEntry->setReplacingEntryId($replacingEntry->getId());
         $recordedEntry->setReplacementStatus(entryReplacementStatus::APPROVED_BUT_NOT_READY);
         $affectedRows = $recordedEntry->save();
         if (!$affectedRows) {
             $replacingEntry->delete();
             $replacingEntry = null;
             if ($retries) {
                 sleep(10);
                 $recordedEntry = entryPeer::retrieveByPKNoFilter($recordedEntry->getId());
                 return kFlowHelper::getReplacingEntry($recordedEntry, $asset, 0);
             } else {
                 KalturaLog::err("Failed to update replacing entry");
                 return null;
             }
         }
     }
     return $replacingEntry;
 }
开发者ID:GElkayam,项目名称:server,代码行数:48,代码来源:kFlowHelper.php

示例9: createReplacigEntry

 private static function createReplacigEntry($recordedEntry)
 {
     $advancedOptions = new kEntryReplacementOptions();
     $advancedOptions->setKeepManualThumbnails(true);
     $recordedEntry->setReplacementOptions($advancedOptions);
     $replacingEntry = new entry();
     $replacingEntry->setType(entryType::MEDIA_CLIP);
     $replacingEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_VIDEO);
     $replacingEntry->setConversionProfileId($recordedEntry->getConversionProfileId());
     $replacingEntry->setName($recordedEntry->getPartnerId() . '_' . time());
     $replacingEntry->setKuserId($recordedEntry->getKuserId());
     $replacingEntry->setAccessControlId($recordedEntry->getAccessControlId());
     $replacingEntry->setPartnerId($recordedEntry->getPartnerId());
     $replacingEntry->setSubpId($recordedEntry->getPartnerId() * 100);
     $replacingEntry->setDefaultModerationStatus();
     $replacingEntry->setDisplayInSearch(mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM);
     $replacingEntry->setReplacedEntryId($recordedEntry->getId());
     $replacingEntry->save();
     $recordedEntry->setReplacingEntryId($replacingEntry->getId());
     $recordedEntry->setReplacementStatus(entryReplacementStatus::APPROVED_BUT_NOT_READY);
     $affectedRows = $recordedEntry->save();
     return $replacingEntry;
 }
开发者ID:wzur,项目名称:server,代码行数:23,代码来源:kFlowHelper.php


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