240069da4dd3456acfd9b437013f5633abb300bb
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\user\notification\object\type;
3 use wcf\data\comment\Comment;
4 use wcf\data\comment\CommentList;
5 use wcf\system\user\notification\object\CommentUserNotificationObject;
6 use wcf\system\WCF;
7
8 /**
9 * Represents a comment notification object type for comments on articles.
10 *
11 * @author Joshua Ruesweg
12 * @copyright 2001-2018 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\User\Notification\Object\Type
15 * @since 3.2
16 */
17 class ArticleCommentUserNotificationObjectType extends AbstractUserNotificationObjectType implements ICommentUserNotificationObjectType {
18 /**
19 * @inheritDoc
20 */
21 protected static $decoratorClassName = CommentUserNotificationObject::class;
22
23 /**
24 * @inheritDoc
25 */
26 protected static $objectClassName = Comment::class;
27
28 /**
29 * @inheritDoc
30 */
31 protected static $objectListClassName = CommentList::class;
32
33 /**
34 * @inheritDoc
35 */
36 public function getOwnerID($objectID) {
37 $sql = "SELECT article.userID
38 FROM wcf".WCF_N."_comment comment
39 LEFT JOIN wcf".WCF_N."_article article
40 ON (article.articleID = comment.objectID)
41 WHERE comment.commentID = ?";
42 $statement = WCF::getDB()->prepareStatement($sql);
43 $statement->execute([$objectID]);
44
45 return $statement->fetchSingleColumn() ?: 0;
46 }
47 }