2 namespace wcf\data\session
;
3 use wcf\data\acp\session\ACPSession
;
7 * Represents a session.
9 * @author Alexander Ebert
10 * @copyright 2001-2014 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf
13 * @subpackage data.session
14 * @category Community Framework
16 class Session
extends ACPSession
{
18 * @see \wcf\data\DatabaseObject::$databaseTableName
20 protected static $databaseTableName = 'session';
23 * @see \wcf\data\DatabaseObject::$databaseTableIndexName
25 protected static $databaseTableIndexName = 'sessionID';
28 * @see \wcf\data\acp\session\ACPSession::supportsPersistentLogins()
30 public static function supportsPersistentLogins() {
35 * @see \wcf\data\acp\session\ACPSession::supportsVirtualSessions()
37 public static function supportsVirtualSessions() {
38 return (SESSION_ENABLE_VIRTUALIZATION
) ?
true : false;
42 * Returns the existing session object for given user id or null if there
45 * @param integer $userID
46 * @return \wcf\data\session\Session
48 public static function getSessionByUserID($userID) {
50 FROM ".static::getDatabaseTableName()."
52 $statement = WCF
::getDB()->prepareStatement($sql);
53 $statement->execute(array($userID));
54 $row = $statement->fetchArray();
60 return new static(null, $row);