* @package generis */ class common_session_AnonymousSession extends common_session_BasicSession implements common_session_StatelessSession { /** * @param SessionContext[] $contexts */ public function __construct($contexts = []) { parent::__construct(new AnonymousUser(), $contexts); } /** * (non-PHPdoc) * @see common_session_Session::getDataLanguage() */ public function getUserLabel() { return __('guest'); } /** * (non-PHPdoc) * @see common_session_Session::getUserRoles() */ public function getUserRoles() { return [GenerisRdf::INSTANCE_ROLE_ANONYMOUS]; } /** * (non-PHPdoc) * @see common_session_Session::getDataLanguage() */ public function getDataLanguage() { return $this->getServiceLocator()->get(UserLanguageServiceInterface::SERVICE_ID)->getDefaultLanguage(); } /** * (non-PHPdoc) * @see common_session_Session::getInterfaceLanguage() */ public function getInterfaceLanguage() { return defined('DEFAULT_ANONYMOUS_INTERFACE_LANG') ? DEFAULT_ANONYMOUS_INTERFACE_LANG : $this->getServiceLocator()->get(UserLanguageServiceInterface::SERVICE_ID)->getDefaultLanguage(); ; } /** * (non-PHPdoc) * @see common_session_Session::getTimeZone() */ public function getTimeZone() { return TIME_ZONE; } /** * (non-PHPdoc) * @see common_session_Session::getUserPropertyValues() */ public function getUserPropertyValues($property) { return []; } /** * (non-PHPdoc) * @see common_session_Session::refresh() */ public function refresh() { // nothing to do here } }