本文整理汇总了PHP中kCurrentContext类的典型用法代码示例。如果您正苦于以下问题:PHP kCurrentContext类的具体用法?PHP kCurrentContext怎么用?PHP kCurrentContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了kCurrentContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doGetListResponse
protected function doGetListResponse(KalturaFilterPager $pager, $type = null)
{
$this->validateEntryIdFiltered();
$this->translateUserIds();
$c = KalturaCriteria::create(CuePointPeer::OM_CLASS);
if ($type) {
$c->add(CuePointPeer::TYPE, $type);
}
$entryIds = null;
if ($this->entryIdEqual) {
$entryIds = array($this->entryIdEqual);
} else {
if ($this->entryIdIn) {
$entryIds = explode(',', $this->entryIdIn);
}
}
if (!is_null($entryIds)) {
$entryIds = entryPeer::filterEntriesByPartnerOrKalturaNetwork($entryIds, kCurrentContext::getCurrentPartnerId());
if (!$entryIds) {
return array(array(), 0);
}
$this->entryIdEqual = null;
$this->entryIdIn = implode(',', $entryIds);
}
$cuePointFilter = $this->toObject();
$cuePointFilter->attachToCriteria($c);
$pager->attachToCriteria($c);
$list = CuePointPeer::doSelect($c);
return array($list, $c->getRecordsCount());
}
开发者ID:AdiTal,项目名称:server,代码行数:30,代码来源:KalturaCuePointFilter.php
示例2: isRelativeTimeEnabled
public static function isRelativeTimeEnabled()
{
if (!kConf::hasParam('disable_relative_time_partners')) {
return true;
}
return !in_array(kCurrentContext::getCurrentPartnerId(), kConf::get('disable_relative_time_partners'));
}
开发者ID:AdiTal,项目名称:server,代码行数:7,代码来源:kTime.class.php
示例3: validateForUpdate
public function validateForUpdate($sourceObject, $propertiesToSkip = array())
{
if (!WidevinePlugin::isAllowedPartner(kCurrentContext::getCurrentPartnerId()) || !WidevinePlugin::isAllowedPartner($sourceObject->getPartnerId())) {
throw new KalturaAPIException(KalturaErrors::PERMISSION_NOT_FOUND, 'Permission not found to use the Widevine feature.');
}
return parent::validateForUpdate($sourceObject, $propertiesToSkip);
}
开发者ID:DBezemer,项目名称:server,代码行数:7,代码来源:KalturaWidevineProfile.php
示例4: createCustomData
public static function createCustomData($entryId, KalturaFlavorAssetArray $flavorAssets, $signingKey)
{
$flavorIds = "";
$first = true;
foreach ($flavorAssets as $flavor) {
/**
* @var asset $flavor
*/
if ($first) {
$first = false;
} else {
$flavorIds .= ",";
}
$flavorIds .= $flavor->id;
}
$innerData = array();
$innerData["ca_system"] = self::SYSTEM_NAME;
$innerData["user_token"] = kCurrentContext::$ks;
$innerData["account_id"] = kCurrentContext::getCurrentPartnerId();
$innerData["content_id"] = $entryId;
$innerData["files"] = $flavorIds;
$customData = array();
foreach ($flavorAssets as $flavor) {
/*
* we sign for each flavor asset in case that in the future someone will want to add data per flavor asset
*/
$innerDataJson = json_encode($innerData);
$innerDataSignature = self::signDataWithKey($innerDataJson, $signingKey);
$innerDataJsonEncoded = rawurlencode(base64_encode($innerDataJson));
$customData[$flavor->id] = array();
$customData[$flavor->id]["custom_data"] = $innerDataJsonEncoded;
$customData[$flavor->id]["signature"] = $innerDataSignature;
}
return $customData;
}
开发者ID:kubrickfr,项目名称:server,代码行数:35,代码来源:DrmLicenseUtils.php
示例5: translateSphinxCriterion
public function translateSphinxCriterion(SphinxCriterion $crit)
{
$field = $crit->getTable() . '.' . $crit->getColumn();
$value = $crit->getValue();
$fieldName = null;
if ($field == TagPeer::OBJECT_TYPE) {
$fieldName = "TagPeer::OBJECT_TYPE";
}
if ($field == TagPeer::PRIVACY_CONTEXT) {
$fieldName = "TagPeer::PRIVACY_CONTEXT";
}
if ($fieldName) {
$partnerIdCrit = $this->getCriterion(TagPeer::PARTNER_ID);
if ($partnerIdCrit && $partnerIdCrit->getComparison() == Criteria::EQUAL) {
$partnerId = $partnerIdCrit->getValue();
} else {
$partnerId = kCurrentContext::getCurrentPartnerId();
}
$value = Tag::getIndexedFieldValue($fieldName, $value, $partnerId);
}
if ($field == TagPeer::TAG && in_array($crit->getComparison(), array(Criteria::EQUAL, Criteria::IN))) {
$value = str_replace(kTagFlowManager::$specialCharacters, kTagFlowManager::$specialCharactersReplacement, $value);
}
return array($field, $crit->getComparison(), $value);
}
开发者ID:DBezemer,项目名称:server,代码行数:25,代码来源:SphinxTagCriteria.php
示例6: processKs
protected function processKs($ksStr, $requiredPermission = null)
{
try {
kCurrentContext::initKsPartnerUser($ksStr);
} catch (Exception $ex) {
KalturaLog::err($ex);
return false;
}
if (kCurrentContext::$ks_object->type != ks::SESSION_TYPE_ADMIN) {
KalturaLog::err('Ks is not admin');
return false;
}
try {
kPermissionManager::init(kConf::get('enable_cache'));
} catch (Exception $ex) {
if (strpos($ex->getCode(), 'INVALID_ACTIONS_LIMIT') === false) {
KalturaLog::err($ex);
return false;
}
}
if ($requiredPermission) {
if (!kPermissionManager::isPermitted(PermissionName::ADMIN_PUBLISHER_MANAGE)) {
KalturaLog::err('Ks is missing "ADMIN_PUBLISHER_MANAGE" permission');
return false;
}
}
return true;
}
开发者ID:dozernz,项目名称:server,代码行数:28,代码来源:oauth2Action.class.php
示例7: notifyAction
/**
* @action notify
* @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
* @param int $id integration job id
*/
public function notifyAction($id)
{
$coreType = IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION);
$batchJob = BatchJobPeer::retrieveByPK($id);
$invalidJobId = false;
$invalidKs = false;
if (!self::validateKs($batchJob)) {
$invalidKs = true;
KalturaLog::err("ks not valid for notifying job [{$id}]");
} elseif (!$batchJob) {
$invalidJobId = true;
KalturaLog::err("Job [{$id}] not found");
} elseif ($batchJob->getJobType() != $coreType) {
$invalidJobId = true;
KalturaLog::err("Job [{$id}] wrong type [" . $batchJob->getJobType() . "] expected [" . $coreType . "]");
} elseif ($batchJob->getStatus() != KalturaBatchJobStatus::ALMOST_DONE) {
$invalidJobId = true;
KalturaLog::err("Job [{$id}] wrong status [" . $batchJob->getStatus() . "] expected [" . KalturaBatchJobStatus::ALMOST_DONE . "]");
} elseif ($batchJob->getPartnerId() != kCurrentContext::getCurrentPartnerId()) {
$invalidKs = true;
KalturaLog::err("Job [{$id}] of wrong partner [" . $batchJob->getPartnerId() . "] expected [" . kCurrentContext::getCurrentPartnerId() . "]");
}
if ($invalidJobId) {
throw new KalturaAPIException(KalturaErrors::INVALID_BATCHJOB_ID, $id);
}
if ($invalidKs) {
throw new KalturaAPIException(KalturaIntegrationErrors::INTEGRATION_NOTIFY_FAILED);
}
kJobsManager::updateBatchJob($batchJob, KalturaBatchJobStatus::FINISHED);
}
开发者ID:DBezemer,项目名称:server,代码行数:35,代码来源:IntegrationService.php
示例8: validateForResponseProfile
public function validateForResponseProfile()
{
if (kEntitlementUtils::getEntitlementEnforcement()) {
if (PermissionPeer::isValidForPartner(PermissionName::FEATURE_ENABLE_RESPONSE_PROFILE_USER_CACHE, kCurrentContext::getCurrentPartnerId())) {
KalturaResponseProfileCacher::useUserCache();
return;
}
throw new KalturaAPIException(KalturaErrors::CANNOT_LIST_RELATED_ENTITLED_WHEN_ENTITLEMENT_IS_ENABLE, get_class($this));
}
}
开发者ID:DBezemer,项目名称:server,代码行数:10,代码来源:KalturaCategoryFilter.php
示例9: setDefaultCriteriaFilter
/**
* Creates default criteria filter
*/
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(KuserKgroupPeer::OM_CLASS);
$c->addAnd(KuserKgroupPeer::STATUS, array(KuserKgroupStatus::DELETED), Criteria::NOT_IN);
$c->addAnd(KuserKgroupPeer::PARTNER_ID, kCurrentContext::getCurrentPartnerId(), Criteria::EQUAL);
self::$s_criteria_filter->setFilter($c);
}
开发者ID:kubrickfr,项目名称:server,代码行数:13,代码来源:KuserKgroupPeer.php
示例10: validateForUsage
public function validateForUsage($sourceObject, $propertiesToSkip = array())
{
parent::validateForUsage($sourceObject, $propertiesToSkip);
$this->validatePropertyNotNull('eventNotificationTemplateId');
myPartnerUtils::addPartnerToCriteria('EventNotificationTemplate', kCurrentContext::getCurrentPartnerId(), true);
$eventNotificationTemplate = EventNotificationTemplatePeer::retrieveByPK($this->eventNotificationTemplateId);
if (is_null($eventNotificationTemplate)) {
throw new KalturaAPIException(KalturaEventNotificationErrors::EVENT_NOTIFICATION_TEMPLATE_NOT_FOUND, $this->eventNotificationTemplateId);
}
}
开发者ID:DBezemer,项目名称:server,代码行数:10,代码来源:KalturaDispatchEventNotificationObjectTask.php
示例11: validateMetadataObjects
public static function validateMetadataObjects($profileField, $objectIds, &$errorMessage)
{
/** @var MetadataProfileField $profileField */
$partnerId = kCurrentContext::getCurrentPartnerId();
$dbObjects = kuserPeer::getKuserByPartnerAndUids($partnerId, $objectIds);
if (count($dbObjects) != count($objectIds)) {
$errorMessage = 'One of the following objects: ' . implode(', ', $objectIds) . ' was not found';
return false;
}
return true;
}
开发者ID:DBezemer,项目名称:server,代码行数:11,代码来源:MetadataKuserPeer.php
示例12: addAction
/**
* Add a new scheduled task profile
*
* @action add
* @param KalturaScheduledTaskProfile $scheduledTaskProfile
* @return KalturaScheduledTaskProfile
*
* @disableRelativeTime $scheduledTaskProfile
*/
public function addAction(KalturaScheduledTaskProfile $scheduledTaskProfile)
{
/* @var $dbScheduledTaskProfile ScheduledTaskProfile */
$dbScheduledTaskProfile = $scheduledTaskProfile->toInsertableObject();
$dbScheduledTaskProfile->setPartnerId(kCurrentContext::getCurrentPartnerId());
$dbScheduledTaskProfile->save();
// return the saved object
$scheduledTaskProfile = new KalturaScheduledTaskProfile();
$scheduledTaskProfile->fromObject($dbScheduledTaskProfile, $this->getResponseProfile());
return $scheduledTaskProfile;
}
开发者ID:DBezemer,项目名称:server,代码行数:20,代码来源:ScheduledTaskProfileService.php
示例13: validateForInsert
public function validateForInsert($propertiesToSkip = array())
{
$partnerId = kCurrentContext::getCurrentPartnerId();
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
throw new KalturaAPIException(KalturaErrors::PARTNER_NOT_FOUND, $partnerId);
}
if (!$partner->getPluginEnabled(FreewheelGenericDistributionPlugin::DEPENDENTS_ON_PLUGIN_NAME_CUE_POINT)) {
throw new KalturaAPIException(KalturaErrors::PLUGIN_NOT_AVAILABLE_FOR_PARTNER, FreewheelGenericDistributionPlugin::DEPENDENTS_ON_PLUGIN_NAME_CUE_POINT, $partnerId);
}
return parent::validateForInsert($propertiesToSkip);
}
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:KalturaFreewheelGenericDistributionProfile.php
示例14: setDefaultCriteriaFilter
public static function setDefaultCriteriaFilter()
{
if (self::$s_criteria_filter == null) {
self::$s_criteria_filter = new criteriaFilter();
}
$c = KalturaCriteria::create(UserEntryPeer::OM_CLASS);
// when session is not admin, allow access to user's userEntries only
if (kCurrentContext::$ks && !kCurrentContext::$is_admin_session) {
$c->addAnd(UserEntryPeer::KUSER_ID, kCurrentContext::getCurrentKsKuserId());
}
self::$s_criteria_filter->setFilter($c);
}
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:UserEntryPeer.php
示例15: validateForUsage
public function validateForUsage($sourceObject, $propertiesToSkip = array())
{
parent::validateForUsage($sourceObject, $propertiesToSkip);
$this->validatePropertyNotNull('metadataProfileId');
$this->validatePropertyNotNull('metadataObjectType');
$this->validatePropertyNotNull('xslt');
myPartnerUtils::addPartnerToCriteria('MetadataProfile', kCurrentContext::getCurrentPartnerId(), true);
$metadataProfile = MetadataProfilePeer::retrieveByPK($this->metadataProfileId);
if (is_null($metadataProfile)) {
throw new KalturaAPIException(MetadataErrors::METADATA_PROFILE_NOT_FOUND, $this->metadataProfileId);
}
}
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:KalturaExecuteMetadataXsltObjectTask.php
示例16: getKuserByPartnerAndUid
/**
* @param int $partnerId
* @param string $puserId
* @param bool $ignore_puser_kuser
* @return kuser
*/
public static function getKuserByPartnerAndUid($partnerId, $puserId, $ignorePuserKuser = false)
{
if (!$ignorePuserKuser && !kCurrentContext::isApiV3Context()) {
$puserKuser = PuserKuserPeer::retrieveByPartnerAndUid($partnerId, 0, $puserId, true);
if ($puserKuser) {
return $puserKuser->getKuser();
}
}
$c = new Criteria();
$c->add(self::PARTNER_ID, $partnerId);
$c->add(self::PUSER_ID, $puserId);
return self::doSelectOne($c);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:19,代码来源:kuserPeer.php
示例17: setPgroupId
public function setPgroupId($pgroupId)
{
if (self::getPgroupId() == $pgroupId) {
// same value - don't set for nothing
return;
}
parent::setPgroupId($pgroupId);
$partnerId = kCurrentContext::getCurrentPartnerId();
$kgroup = kuserPeer::getKuserByPartnerAndUid($partnerId, $pgroupId, false, KuserType::GROUP);
if (!$kgroup) {
throw new kCoreException("Invalid group Id [{$pgroupId}]", kCoreException::INVALID_USER_ID);
}
parent::setKgroupId($kgroup->getId());
}
开发者ID:AdiTal,项目名称:server,代码行数:14,代码来源:KuserKgroup.php
示例18: doGetListResponse
protected function doGetListResponse(KalturaFilterPager $pager, array $types = null)
{
$this->validateEntryIdFiltered();
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
// verify access to the relevant entries - either same partner as the KS or kaltura network
if ($this->entryIdEqual) {
$entryIds = array($this->entryIdEqual);
} else {
if ($this->entryIdIn) {
$entryIds = explode(',', $this->entryIdIn);
} else {
throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'KalturaAssetFilter::entryIdEqual/KalturaAssetFilter::entryIdIn');
}
}
$entryIds = array_slice($entryIds, 0, baseObjectFilter::getMaxInValues());
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$c->addAnd(entryPeer::ID, $entryIds, Criteria::IN);
$criterionPartnerOrKn = $c->getNewCriterion(entryPeer::PARTNER_ID, kCurrentContext::getCurrentPartnerId());
$criterionPartnerOrKn->addOr($c->getNewCriterion(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK));
$c->addAnd($criterionPartnerOrKn);
$dbEntries = entryPeer::doSelect($c);
if (!$dbEntries) {
return array(array(), 0);
}
$entryIds = array();
foreach ($dbEntries as $dbEntry) {
$entryIds[] = $dbEntry->getId();
}
$this->entryIdEqual = null;
$this->entryIdIn = implode(',', $entryIds);
// get the flavors
$flavorAssetFilter = new AssetFilter();
$this->toObject($flavorAssetFilter);
$c = new Criteria();
$flavorAssetFilter->attachToCriteria($c);
if ($types) {
$c->add(assetPeer::TYPE, $types, Criteria::IN);
}
$pager->attachToCriteria($c);
$list = assetPeer::doSelect($c);
$resultCount = count($list);
if ($resultCount && $resultCount < $pager->pageSize) {
$totalCount = ($pager->pageIndex - 1) * $pager->pageSize + $resultCount;
} else {
KalturaFilterPager::detachFromCriteria($c);
$totalCount = assetPeer::doCount($c);
}
myDbHelper::$use_alternative_con = null;
return array($list, $totalCount);
}
开发者ID:visomar,项目名称:server,代码行数:50,代码来源:KalturaAssetFilter.php
示例19: fixFilterUserId
/**
* The user_id is infact a puser_id and the kuser_id should be retrieved
*/
protected function fixFilterUserId()
{
if ($this->userIdEqual !== null) {
$kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::getCurrentPartnerId(), $this->userIdEqual);
if ($kuser) {
$this->userIdEqual = $kuser->getId();
} else {
$this->userIdEqual = -1;
}
// no result will be returned when the user is missing
}
if (!empty($this->userIdIn)) {
$this->userIdIn = $this->preparePusersToKusersFilter($this->userIdIn);
}
}
开发者ID:DBezemer,项目名称:server,代码行数:18,代码来源:KalturaUserEntryFilter.php
示例20: getKuserByPartnerAndUid
/**
* @param int $partnerId
* @param string $puserId
* @param bool $ignore_puser_kuser
* @return kuser
*/
public static function getKuserByPartnerAndUid($partnerId, $puserId, $ignorePuserKuser = false)
{
if (!$ignorePuserKuser && !kCurrentContext::isApiV3Context()) {
$puserKuser = PuserKuserPeer::retrieveByPartnerAndUid($partnerId, 0, $puserId, true);
if ($puserKuser) {
return $puserKuser->getKuser();
}
}
$c = new Criteria();
$c->add(self::PARTNER_ID, $partnerId);
$c->add(self::PUSER_ID, $puserId);
// in case of more than one deleted kusers - get the last one
$c->addDescendingOrderByColumn(kuserPeer::UPDATED_AT);
return self::doSelectOne($c);
}
开发者ID:DBezemer,项目名称:server,代码行数:21,代码来源:kuserPeer.php
注:本文中的kCurrentContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论