c401abfe92650a6cc2f64bf87601091dda2880dd
[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\system\WCF;
7
8 /**
9 * Implements IMultiRecipientCommentUserNotificationObjectType::getRecipientIDs()
10 * for page comment user notification object types.
11 *
12 * @author Joshua Ruesweg
13 * @copyright 2001-2019 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @since 5.2
16 */
17 trait TMultiRecipientPageCommentUserNotificationObjectType
18 {
19 /**
20 * @inheritDoc
21 */
22 public function getRecipientIDs(Comment $comment)
23 {
24 // find all userIDs with the permission to manage pages
25 $sql = "SELECT userID
26 FROM wcf" . WCF_N . "_user_to_group
27 INNER JOIN wcf" . WCF_N . "_user_group_option_value
28 ON wcf" . WCF_N . "_user_to_group.groupID = wcf" . WCF_N . "_user_group_option_value.groupID
29 AND wcf" . WCF_N . "_user_group_option_value.optionValue = ?
30 INNER JOIN wcf" . WCF_N . "_user_group_option
31 ON wcf" . WCF_N . "_user_group_option_value.optionID = wcf" . WCF_N . "_user_group_option.optionID
32 AND wcf" . WCF_N . "_user_group_option.optionName = ?";
33 $statement = WCF::getDB()->prepareStatement($sql);
34 $statement->execute([
35 1,
36 'admin.content.cms.canManagePage',
37 ]);
38
39 return $statement->fetchAll(\PDO::FETCH_COLUMN);
40 }
41 }