本文整理汇总了PHP中entry::getPuserId方法的典型用法代码示例。如果您正苦于以下问题:PHP entry::getPuserId方法的具体用法?PHP entry::getPuserId怎么用?PHP entry::getPuserId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entry
的用法示例。
在下文中一共展示了entry::getPuserId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: typeMatches
public function typeMatches(entry $entry)
{
if ($this->get('_eq_type') && $entry->getType() != $this->get('_eq_type')) {
return false;
}
if ($this->get('_in_type') && !in_array($entry->getType(), explode(',', $this->get('_in_type')))) {
return false;
}
if ($this->get('_in_user_id') && !in_array($entry->getPuserId(), explode(',', $this->get('_in_user_id')))) {
return false;
}
return true;
}
示例2: 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());
}
示例3: 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__ . "]");
}
示例4: createNotificationBulkDownloadSucceeded
private static function createNotificationBulkDownloadSucceeded(BatchJob $dbBatchJob, entry $entry, flavorAsset $flavorAsset, FileSyncKey $syncKey)
{
$localPath = kFileSyncUtils::getLocalFilePathForKey($syncKey);
$downloadUrl = $flavorAsset->getDownloadUrl();
$notificationData = array("puserId" => $entry->getPuserId(), "entryId" => $entry->getId(), "entryIntId" => $entry->getIntId(), "entryVersion" => $entry->getVersion(), "fileFormat" => $flavorAsset->getFileExt(), "archivedFile" => $localPath, "downoladPath" => $localPath, "conversionQuality" => $entry->getConversionQuality(), "downloadUrl" => $downloadUrl);
$extraData = array("data" => json_encode($notificationData), "partner_id" => $entry->getPartnerId(), "puser_id" => $entry->getPuserId(), "entry_id" => $entry->getId(), "entry_int_id" => $entry->getIntId(), "entry_version" => $entry->getVersion(), "file_format" => $flavorAsset->getFileExt(), "archived_file" => $localPath, "downolad_path" => $localPath, "target" => $localPath, "conversion_quality" => $entry->getConversionQuality(), "download_url" => $downloadUrl, "status" => $entry->getStatus(), "abort" => $dbBatchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED, "message" => $dbBatchJob->getMessage(), "description" => $dbBatchJob->getDescription(), "job_type" => BatchJobType::DOWNLOAD, "status" => BatchJob::BATCHJOB_STATUS_FINISHED, "progress" => 100, "debug" => __LINE__);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_BATCH_JOB_SUCCEEDED, $dbBatchJob, $dbBatchJob->getPartnerId(), null, null, $extraData, $dbBatchJob->getEntryId());
}
示例5: getEntryMrssXml
/**
* @param entry $entry
* @param SimpleXMLElement $mrss
* @param kMrssParameters $mrssParams
* @params string $features
* @return SimpleXMLElement
*/
public static function getEntryMrssXml(entry $entry, SimpleXMLElement $mrss = null, kMrssParameters $mrssParams = null, $features = null)
{
$instanceKey = self::generateInstanceKey($entry->getId(), $mrssParams, $features);
if (is_null($mrss)) {
$mrss = self::getInstanceFromPool($instanceKey);
if ($mrss) {
return $mrss;
}
$encoding = 'UTF-8';
if ($mrssParams && !is_null($mrssParams->getEncoding())) {
$encoding = $mrssParams->getEncoding();
}
if ($encoding) {
$mrss = new SimpleXMLElement('<?xml version="1.0" encoding="' . $encoding . '"?><item/>');
} else {
$mrss = new SimpleXMLElement('<item/>');
}
}
$mrss->addChild('entryId', $entry->getId());
if ($entry->getReferenceID()) {
$mrss->addChild('referenceID', self::stringToSafeXml($entry->getReferenceID()));
}
$mrss->addChild('createdAt', $entry->getCreatedAt(null));
$mrss->addChild('updatedAt', $entry->getUpdatedAt(null));
$mrss->addChild('title', self::stringToSafeXml($entry->getName()));
if ($mrssParams && !is_null($mrssParams->getLink())) {
$mrss->addChild('link', $mrssParams->getLink() . $entry->getId());
}
$mrss->addChild('type', $entry->getType());
$mrss->addChild('licenseType', $entry->getLicenseType());
$mrss->addChild('userId', $entry->getPuserId());
$mrss->addChild('name', self::stringToSafeXml($entry->getName()));
$mrss->addChild('status', self::stringToSafeXml($entry->getStatus()));
$mrss->addChild('description', self::stringToSafeXml($entry->getDescription()));
$thumbnailUrl = $mrss->addChild('thumbnailUrl');
$thumbnailUrl->addAttribute('url', $entry->getThumbnailUrl());
if (trim($entry->getTags(), " \r\n\t")) {
$tags = $mrss->addChild('tags');
foreach (explode(',', $entry->getTags()) as $tag) {
$tags->addChild('tag', self::stringToSafeXml($tag));
}
}
$categories = explode(',', $entry->getCategories());
if (count($features) && in_array(ObjectFeatureType::CATEGORY_ENTRIES, $features)) {
$partner = PartnerPeer::retrieveByPK(kCurrentContext::getCurrentPartnerId());
$partnerEntitlement = $partner->getDefaultEntitlementEnforcement();
kEntitlementUtils::initEntitlementEnforcement($partner->getId(), false);
$categories = array();
$categoryEntries = categoryEntryPeer::retrieveActiveByEntryId($entry->getId());
$categoryIds = array();
foreach ($categoryEntries as $categoryEntry) {
$categoryIds[] = $categoryEntry->getCategoryId();
}
$entryCats = categoryPeer::retrieveByPKs($categoryIds);
foreach ($entryCats as $entryCat) {
$categories[] = $entryCat->getFullName();
}
if ($partnerEntitlement) {
kEntitlementUtils::initEntitlementEnforcement($partner->getId(), true);
}
$keyToDelete = array_search(ObjectFeatureType::CATEGORY_ENTRIES, $features);
unset($features[$keyToDelete]);
}
foreach ($categories as $category) {
$category = trim($category);
if ($category) {
$categoryNode = $mrss->addChild('category', self::stringToSafeXml($category));
if (strrpos($category, '>') > 0) {
$categoryNode->addAttribute('name', self::stringToSafeXml(substr($category, strrpos($category, '>') + 1)));
} else {
$categoryNode->addAttribute('name', self::stringToSafeXml($category));
}
}
}
$mrss->addChild('partnerData', self::stringToSafeXml($entry->getPartnerData()));
if ($entry->getAccessControlId()) {
$mrss->addChild('accessControlId', $entry->getAccessControlId());
}
if ($entry->getConversionProfileId()) {
$mrss->addChild('conversionProfileId', $entry->getConversionProfileId());
}
if ($entry->getStartDate(null)) {
$mrss->addChild('startDate', $entry->getStartDate(null));
}
if ($entry->getEndDate(null)) {
$mrss->addChild('endDate', $entry->getEndDate(null));
}
switch ($entry->getType()) {
case entryType::MEDIA_CLIP:
self::appendMediaEntryMrss($entry, $mrss);
break;
case entryType::MIX:
self::appendMixEntryMrss($entry, $mrss);
//.........这里部分代码省略.........
示例6: getEntryMrssXml
/**
* @param entry $entry
* @param SimpleXMLElement $mrss
* @param kMrssParameters $mrssParams
* @return SimpleXMLElement
*/
public static function getEntryMrssXml(entry $entry, SimpleXMLElement $mrss = null, kMrssParameters $mrssParams = null)
{
if ($mrss === null) {
$mrss = new SimpleXMLElement('<item/>');
}
$mrss->addChild('entryId', $entry->getId());
if ($entry->getReferenceID()) {
$mrss->addChild('referenceID', $entry->getReferenceID());
}
$mrss->addChild('createdAt', $entry->getCreatedAt(null));
$mrss->addChild('updatedAt', $entry->getUpdatedAt(null));
$mrss->addChild('title', self::stringToSafeXml($entry->getName()));
if ($mrssParams && !is_null($mrssParams->getLink())) {
$mrss->addChild('link', $mrssParams->getLink() . $entry->getId());
}
$mrss->addChild('type', $entry->getType());
$mrss->addChild('licenseType', $entry->getLicenseType());
$mrss->addChild('userId', $entry->getPuserId(true));
$mrss->addChild('name', self::stringToSafeXml($entry->getName()));
$mrss->addChild('status', self::stringToSafeXml($entry->getStatus()));
$mrss->addChild('description', self::stringToSafeXml($entry->getDescription()));
$thumbnailUrl = $mrss->addChild('thumbnailUrl');
$thumbnailUrl->addAttribute('url', $entry->getThumbnailUrl());
if (trim($entry->getTags(), " \r\n\t")) {
$tags = $mrss->addChild('tags');
foreach (explode(',', $entry->getTags()) as $tag) {
$tags->addChild('tag', self::stringToSafeXml($tag));
}
}
$categories = explode(',', $entry->getCategories());
foreach ($categories as $category) {
$category = trim($category);
if ($category) {
$categoryNode = $mrss->addChild('category', self::stringToSafeXml($category));
if (strrpos($category, '>') > 0) {
$categoryNode->addAttribute('name', self::stringToSafeXml(substr($category, strrpos($category, '>') + 1)));
} else {
$categoryNode->addAttribute('name', self::stringToSafeXml($category));
}
}
}
$mrss->addChild('partnerData', self::stringToSafeXml($entry->getPartnerData()));
if ($entry->getAccessControlId()) {
$mrss->addChild('accessControlId', $entry->getAccessControlId());
}
if ($entry->getConversionProfileId()) {
$mrss->addChild('conversionProfileId', $entry->getConversionProfileId());
}
if ($entry->getStartDate(null)) {
$mrss->addChild('startDate', $entry->getStartDate(null));
}
if ($entry->getEndDate(null)) {
$mrss->addChild('endDate', $entry->getEndDate(null));
}
switch ($entry->getType()) {
case entryType::MEDIA_CLIP:
self::appendMediaEntryMrss($entry, $mrss);
break;
case entryType::MIX:
self::appendMixEntryMrss($entry, $mrss);
break;
case entryType::PLAYLIST:
self::appendPlaylistEntryMrss($entry, $mrss);
break;
case entryType::DATA:
self::appendDataEntryMrss($entry, $mrss);
break;
case entryType::LIVE_STREAM:
self::appendLiveStreamEntryMrss($entry, $mrss);
break;
default:
break;
}
$assets = assetPeer::retrieveReadyByEntryId($entry->getId());
foreach ($assets as $asset) {
if ($mrssParams && !is_null($mrssParams->getFilterByFlavorParams()) && $asset->getFlavorParamsId() != $mrssParams->getFilterByFlavorParams()) {
continue;
}
if ($asset instanceof flavorAsset) {
self::appendFlavorAssetMrss($asset, $mrss, $mrssParams);
}
if ($asset instanceof thumbAsset) {
self::appendThumbAssetMrss($asset, $mrss);
}
}
$mrssContributors = self::getMrssContributors();
if (count($mrssContributors)) {
foreach ($mrssContributors as $mrssContributor) {
$mrssContributor->contribute($entry, $mrss, $mrssParams);
}
}
if ($mrssParams && $mrssParams->getIncludePlayerTag()) {
$uiconfId = !is_null($mrssParams->getPlayerUiconfId()) ? '/ui_conf_id/' . $mrssParams->getPlayerUiconfId() : '';
$playerUrl = 'http://' . kConf::get('www_host') . '/kwidget/wid/_' . $entry->getPartnerId() . '/entry_id/' . $entry->getId() . '/ui_conf' . ($uiconfId ? "/{$uiconfId}" : '');
//.........这里部分代码省略.........
示例7: getEntryMrssXml
/**
* @param entry $entry
* @param SimpleXMLElement $mrss
* @param string $link
* @param string $filterFlavors
* @return SimpleXMLElement
*/
public static function getEntryMrssXml(entry $entry, SimpleXMLElement $mrss = null, $link = null, $fitlerByFlovorParams = null)
{
if (!$mrss) {
$mrss = new SimpleXMLElement('<item/>');
}
$mrss->addChild('entryId', $entry->getId());
$mrss->addChild('createdAt', $entry->getCreatedAt(null));
$mrss->addChild('title', self::stringToSafeXml($entry->getName()));
$mrss->addChild('link', $link . $entry->getId());
$mrss->addChild('type', $entry->getType());
$mrss->addChild('licenseType', $entry->getLicenseType());
$mrss->addChild('userId', $entry->getPuserId(true));
$mrss->addChild('name', self::stringToSafeXml($entry->getName()));
$mrss->addChild('description', self::stringToSafeXml($entry->getDescription()));
$thumbnailUrl = $mrss->addChild('thumbnailUrl');
$thumbnailUrl->addAttribute('url', $entry->getThumbnailUrl());
$tags = $mrss->addChild('tags');
foreach (explode(',', $entry->getTags()) as $tag) {
$tags->addChild('tag', self::stringToSafeXml($tag));
}
$mrss->addChild('partnerData', self::stringToSafeXml($entry->getPartnerData()));
$mrss->addChild('accessControlId', $entry->getAccessControlId());
$categories = explode(',', $entry->getCategories());
foreach ($categories as $category) {
if ($category) {
$mrss->addChild('category', self::stringToSafeXml($category));
}
}
if ($entry->getStartDate(null)) {
$mrss->addChild('startDate', $entry->getStartDate(null));
}
if ($entry->getEndDate(null)) {
$mrss->addChild('endDate', $entry->getEndDate(null));
}
switch ($entry->getType()) {
case entryType::MEDIA_CLIP:
self::appendMediaEntryMrss($entry, $mrss);
break;
case entryType::MIX:
self::appendMixEntryMrss($entry, $mrss);
break;
case entryType::PLAYLIST:
self::appendPlaylistEntryMrss($entry, $mrss);
break;
case entryType::DATA:
self::appendDataEntryMrss($entry, $mrss);
break;
case entryType::LIVE_STREAM:
self::appendLiveStreamEntryMrss($entry, $mrss);
break;
default:
break;
}
$flavorAssets = flavorAssetPeer::retreiveReadyByEntryId($entry->getId());
foreach ($flavorAssets as $flavorAsset) {
if (!is_null($fitlerByFlovorParams) && $flavorAsset->getFlavorParamsId() != $fitlerByFlovorParams) {
continue;
}
$content = $mrss->addChild('content');
$content->addAttribute('url', self::getAssetUrl($flavorAsset));
$content->addAttribute('flavorAssetId', $flavorAsset->getId());
$content->addAttribute('isSource', $flavorAsset->getIsOriginal() ? 'true' : 'false');
$content->addAttribute('containerFormat', $flavorAsset->getContainerFormat());
$content->addAttribute('extension', $flavorAsset->getFileExt());
if (!is_null($flavorAsset->getFlavorParamsId())) {
$content->addAttribute('flavorParamsId', $flavorAsset->getFlavorParamsId());
$flavorParams = flavorParamsPeer::retrieveByPK($flavorAsset->getFlavorParamsId());
if ($flavorParams) {
$content->addAttribute('flavorParamsName', $flavorParams->getName());
$content->addAttribute('format', $flavorParams->getFormat());
$content->addAttribute('videoBitrate', $flavorParams->getVideoBitrate());
$content->addAttribute('videoCodec', $flavorParams->getVideoCodec());
$content->addAttribute('audioBitrate', $flavorParams->getAudioBitrate());
$content->addAttribute('audioCodec', $flavorParams->getAudioCodec());
$content->addAttribute('frameRate', $flavorParams->getFrameRate());
$content->addAttribute('height', $flavorParams->getHeight());
$content->addAttribute('width', $flavorParams->getWidth());
}
}
$tags = $content->addChild('tags');
foreach (explode(',', $flavorAsset->getTags()) as $tag) {
$tags->addChild('tag', self::stringToSafeXml($tag));
}
}
$thumbAssets = thumbAssetPeer::retreiveReadyByEntryId($entry->getId());
foreach ($thumbAssets as $thumbAsset) {
$thumbnail = $mrss->addChild('thumbnail');
$thumbnail->addAttribute('url', self::getAssetUrl($thumbAsset));
$thumbnail->addAttribute('thumbAssetId', $thumbAsset->getId());
$thumbnail->addAttribute('isDefault', $thumbAsset->hasTag(thumbParams::TAG_DEFAULT_THUMB) ? 'true' : 'false');
$thumbnail->addAttribute('format', $thumbAsset->getContainerFormat());
if ($thumbAsset->getFlavorParamsId()) {
$thumbnail->addAttribute('thumbParamsId', $thumbAsset->getFlavorParamsId());
//.........这里部分代码省略.........