Conflicts resolved
authorMarcel Werk <burntime@woltlab.com>
Wed, 20 Jul 2011 12:30:54 +0000 (14:30 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 20 Jul 2011 12:30:54 +0000 (14:30 +0200)
1  2 
com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php
com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php

index b92e2fe728a164f7416fa1edaab7b4d146717d0f,a83c59659d425c124bff6d3b9fbd231273e64247..36004ef7c537632c2d2ab9624459a7d11107bcff
@@@ -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;
 +      }
  }