本文整理汇总了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);
}
}