From: Marcel Werk Date: Wed, 20 Jul 2011 12:30:54 +0000 (+0200) Subject: Conflicts resolved X-Git-Tag: 2.0.0_Beta_1~1987 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e89fce6b0f2e9c338aefaa763edb9b23cac9426;p=GitHub%2FWoltLab%2FWCF.git Conflicts resolved --- 7e89fce6b0f2e9c338aefaa763edb9b23cac9426 diff --cc com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php index b92e2fe728,a83c59659d..36004ef7c5 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php +++ b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php @@@ -15,33 -14,7 +15,33 @@@ use wcf\system\WCF */ class UserNotificationEditor extends DatabaseObjectEditor { /** - * @see DatabaseObjectDecorator::$baseClass + * @see wcf\data\DatabaseObjectDecorator::$baseClass */ protected static $baseClass = 'wcf\data\user\notification\UserNotification'; + + /** + * @see EditableObject::create() + */ + public static function create(array $parameters = array()) { + $recipientIDs = array(); + if (isset($parameters['recipientIDs']) && is_array($parameters['recipientIDs'])) { + $recipientIDs = $parameters['recipientIDs']; + unset($parameters['recipientIDs']); + } + + $notification = parent::create($parameters); + + // save recpients + if (count($recipientIDs)) { + $sql = "INSERT INTO wcf".WCF_N."_user_notification_to_user + (notificationID, userID) + VALUES (?, ?)"; + $statement = WCF::getDB()->prepareStatement($sql); + foreach ($recipientIDs as $recipientID) { + $statement->execute(array($notification->notificationID, $recipientID)); + } + } + + return $notification; + } }