2 namespace wcf\data\user\follow
;
3 use wcf\data\DatabaseObject
;
7 * Represents a user's follower.
9 * @author Alexander Ebert
10 * @copyright 2001-2013 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf.user
13 * @subpackage data.user.follow
14 * @category Community Framework
16 class UserFollow
extends DatabaseObject
{
18 * @see wcf\data\DatabaseObject::$databaseTableName
20 protected static $databaseTableName = 'user_follow';
23 * @see wcf\data\DatabaseObject::$databaseTableIndexName
25 protected static $databaseTableIndexName = 'followID';
28 * Retrieves a follower.
30 * @param integer $userID
31 * @param integer $followUserID
32 * @return wcf\data\user\follow\UserFollow
34 public static function getFollow($userID, $followUserID) {
35 $sql = "SELECT followID
36 FROM wcf".WCF_N
."_user_follow
38 AND followUserID = ?";
39 $statement = WCF
::getDB()->prepareStatement($sql);
40 $statement->execute(array(
45 $row = $statement->fetchArray();
46 if (!$row) $row = array();
48 return new UserFollow(null, $row);