private static function getObjectTypeCacheKey(IRelatedObject $object) { $userRoles = kPermissionManager::getCurrentRoleIds(); sort($userRoles); $objectType = get_class($object); $partnerId = self::$cachedObject->getPartnerId(); $profileKey = self::$responseProfileKey; $protocol = infraRequestUtils::getProtocol(); $ksType = kCurrentContext::getCurrentSessionType(); $userRoles = implode('-', $userRoles); $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; return "relate_rp{$profileKey}_p{$partnerId}_o{$objectType}_h{$protocol}_k{$ksType}_u{$userRoles}_w{$host}"; }
protected static function getSessionKey($protocol = null, $ksType = null, array $userRoles = null, $host = null) { if (!$protocol) { $protocol = infraRequestUtils::getProtocol(); } if (!$ksType) { $ksType = kCurrentContext::getCurrentSessionType(); } if (!$userRoles) { $userRoles = kPermissionManager::getCurrentRoleIds(); } if (!$host) { $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; } sort($userRoles); $userRole = implode('-', $userRoles); return "{$protocol}_{$ksType}_{$host}_{$userRole}"; }