本文整理匯總了PHP中kEntitlementUtils::entitlementForced方法的典型用法代碼示例。如果您正苦於以下問題:PHP kEntitlementUtils::entitlementForced方法的具體用法?PHP kEntitlementUtils::entitlementForced怎麽用?PHP kEntitlementUtils::entitlementForced使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kEntitlementUtils
的用法示例。
在下文中一共展示了kEntitlementUtils::entitlementForced方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initEntitlementEnforcement
/**
* Set Entitlement Enforcement - if entitelement is enabled \ disabled in this session
* @param int $categoryId
* @param int $kuser
* @return bool
*/
public static function initEntitlementEnforcement($partnerId = null, $enableEntit = null)
{
self::$initialized = true;
self::$entitlementForced = $enableEntit;
if (is_null($partnerId)) {
$partnerId = kCurrentContext::getCurrentPartnerId();
}
if (is_null($partnerId) || $partnerId == Partner::BATCH_PARTNER_ID) {
return;
}
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
return;
}
$ks = null;
$ksString = kCurrentContext::$ks ? kCurrentContext::$ks : '';
if ($ksString != '') {
$ks = ks::fromSecureString($ksString);
}
self::initCategoryModeration($ks);
if (!PermissionPeer::isValidForPartner(PermissionName::FEATURE_ENTITLEMENT, $partnerId)) {
return;
}
$partnerDefaultEntitlementEnforcement = $partner->getDefaultEntitlementEnforcement();
// default entitlement scope is true - enable.
if (is_null($partnerDefaultEntitlementEnforcement)) {
$partnerDefaultEntitlementEnforcement = true;
}
self::$entitlementEnforcement = $partnerDefaultEntitlementEnforcement;
if ($ks) {
$enableEntitlement = $ks->getDisableEntitlement();
if ($enableEntitlement) {
self::$entitlementEnforcement = false;
}
$enableEntitlement = $ks->getEnableEntitlement();
if ($enableEntitlement) {
self::$entitlementEnforcement = true;
}
}
if (!is_null($enableEntit)) {
if ($enableEntit) {
self::$entitlementEnforcement = true;
} else {
self::$entitlementEnforcement = false;
}
}
if (self::$entitlementEnforcement) {
KalturaCriterion::enableTag(KalturaCriterion::TAG_ENTITLEMENT_ENTRY);
KalturaCriterion::enableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
}
}