3 namespace wcf\data\user\
object\watch
;
5 use wcf\data\DatabaseObject
;
9 * Represents a watched object.
12 * @copyright 2001-2019 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\Data\User\Object\Watch
16 * @property-read int $watchID unique id of the watched object
17 * @property-read int $objectTypeID id of the `com.woltlab.wcf.user.objectWatch` object type
18 * @property-read int $objectID id of the watched object of the specific object type
19 * @property-read int $userID id of the user watching the object
20 * @property-read int $notification is `1` if the user wants to receive notifications for the watched object, otherwise `0`
22 class UserObjectWatch
extends DatabaseObject
25 * Returns the UserObjectWatch with the given data or null if no such object
28 * @param int $objectTypeID
30 * @param int $objectID
31 * @return UserObjectWatch|null
33 public static function getUserObjectWatch($objectTypeID, $userID, $objectID)
36 FROM wcf" . WCF_N
. "_user_object_watch
37 WHERE objectTypeID = ?
40 $statement = WCF
::getDB()->prepareStatement($sql);
41 $statement->execute([$objectTypeID, $userID, $objectID]);
42 $row = $statement->fetch();
47 return new self(null, $row);