本文整理汇总了PHP中kCurrentContext::getCurrentPartnerId方法的典型用法代码示例。如果您正苦于以下问题:PHP kCurrentContext::getCurrentPartnerId方法的具体用法?PHP kCurrentContext::getCurrentPartnerId怎么用?PHP kCurrentContext::getCurrentPartnerId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kCurrentContext
的用法示例。
在下文中一共展示了kCurrentContext::getCurrentPartnerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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;
}
示例6: 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());
}
示例7: 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);
}
}
示例8: 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);
}
示例9: 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));
}
}
示例10: 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;
}
示例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;
}
示例12: 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);
}
}
示例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);
}
示例14: 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());
}
示例15: 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);
}