Unify the terms 'Staff' and 'Team'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / user / follow / UserFollow.class.php
... / ...
CommitLineData
1<?php
2
3namespace wcf\data\user\follow;
4
5use wcf\data\DatabaseObject;
6use wcf\system\WCF;
7
8/**
9 * Represents a user's follower.
10 *
11 * @author Alexander Ebert
12 * @copyright 2001-2019 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 *
15 * @property-read int $followID unique id of the following relation
16 * @property-read int $userID id of the following user
17 * @property-read int $followUserID id of the followed user
18 * @property-read int $time time at which following relation has been established
19 */
20class UserFollow extends DatabaseObject
21{
22 /**
23 * Retrieves a follower.
24 *
25 * @param int $userID
26 * @param int $followUserID
27 * @return UserFollow
28 */
29 public static function getFollow($userID, $followUserID)
30 {
31 $sql = "SELECT followID
32 FROM wcf" . WCF_N . "_user_follow
33 WHERE userID = ?
34 AND followUserID = ?";
35 $statement = WCF::getDB()->prepareStatement($sql);
36 $statement->execute([
37 $userID,
38 $followUserID,
39 ]);
40
41 $row = $statement->fetchArray();
42 if (!$row) {
43 $row = [];
44 }
45
46 return new self(null, $row);
47 }
48}