1dee5b95df68cbccb0a646286afeb15efcab5dca
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 namespace wcf\system\user\notification\object\type;
4
5 use wcf\data\comment\Comment;
6 use wcf\data\comment\CommentList;
7 use wcf\system\user\notification\object\CommentUserNotificationObject;
8 use wcf\system\WCF;
9
10 /**
11 * Represents a comment notification object type.
12 *
13 * @author Alexander Ebert
14 * @copyright 2001-2019 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 */
17 class UserProfileCommentUserNotificationObjectType extends AbstractUserNotificationObjectType implements
18 ICommentUserNotificationObjectType
19 {
20 /**
21 * @inheritDoc
22 */
23 protected static $decoratorClassName = CommentUserNotificationObject::class;
24
25 /**
26 * @inheritDoc
27 */
28 protected static $objectClassName = Comment::class;
29
30 /**
31 * @inheritDoc
32 */
33 protected static $objectListClassName = CommentList::class;
34
35 /**
36 * @inheritDoc
37 */
38 public function getOwnerID($objectID)
39 {
40 $sql = "SELECT objectID
41 FROM wcf" . WCF_N . "_comment
42 WHERE commentID = ?";
43 $statement = WCF::getDB()->prepareStatement($sql);
44 $statement->execute([$objectID]);
45 $row = $statement->fetchArray();
46
47 return $row ? $row['objectID'] : 0;
48 }
49 }