84c83069b64880bce00e9293b4b13f836f0ec850
[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 for comments on articles.
12 *
13 * @author Joshua Ruesweg
14 * @copyright 2001-2019 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @package WoltLabSuite\Core\System\User\Notification\Object\Type
17 * @since 5.2
18 */
19 class ArticleCommentUserNotificationObjectType extends AbstractUserNotificationObjectType implements
20 ICommentUserNotificationObjectType
21 {
22 /**
23 * @inheritDoc
24 */
25 protected static $decoratorClassName = CommentUserNotificationObject::class;
26
27 /**
28 * @inheritDoc
29 */
30 protected static $objectClassName = Comment::class;
31
32 /**
33 * @inheritDoc
34 */
35 protected static $objectListClassName = CommentList::class;
36
37 /**
38 * @inheritDoc
39 */
40 public function getOwnerID($objectID)
41 {
42 $sql = "SELECT article.userID
43 FROM wcf" . WCF_N . "_comment comment
44 LEFT JOIN wcf" . WCF_N . "_article article
45 ON article.articleID = comment.objectID
46 WHERE comment.commentID = ?";
47 $statement = WCF::getDB()->prepareStatement($sql);
48 $statement->execute([$objectID]);
49
50 return $statement->fetchSingleColumn() ?: 0;
51 }
52 }