From: Matthias Schmidt Date: Sun, 27 Jul 2014 09:18:17 +0000 (+0200) Subject: Use general LikeUserNotificationObject(Type) classes X-Git-Tag: 2.1.0_Alpha_1~530 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb0c84a905f96f1b853b91a8778094c8b0985297;p=GitHub%2FWoltLab%2FWCF.git Use general LikeUserNotificationObject(Type) classes --- diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 0080bf9e0c..59665ac26d 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -207,13 +207,13 @@ com.woltlab.wcf.user.profileComment.like.notification com.woltlab.wcf.notification.objectType - + com.woltlab.wcf.user com.woltlab.wcf.user.profileComment.response.like.notification com.woltlab.wcf.notification.objectType - + com.woltlab.wcf.user diff --git a/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php b/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php index 458d3a62bc..c9b4c66b08 100644 --- a/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php +++ b/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php @@ -4,7 +4,7 @@ use wcf\data\like\object\AbstractLikeObject; use wcf\data\like\Like; use wcf\data\object\type\ObjectTypeCache; use wcf\system\comment\CommentHandler; -use wcf\system\user\notification\object\CommentLikeUserNotificationObject; +use wcf\system\user\notification\object\LikeUserNotificationObject; use wcf\system\user\notification\UserNotificationHandler; use wcf\system\WCF; @@ -64,7 +64,7 @@ class LikeableComment extends AbstractLikeObject { if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.like.notification')) { $notificationObjectType = UserNotificationHandler::getInstance()->getObjectTypeProcessor($objectType->objectType.'.like.notification'); if ($this->userID != WCF::getUser()->userID) { - $notificationObject = new CommentLikeUserNotificationObject($like); + $notificationObject = new LikeUserNotificationObject($like); UserNotificationHandler::getInstance()->fireEvent('like', $objectType->objectType.'.like.notification', $notificationObject, array($this->userID), array( 'objectID' => $this->object->objectID, 'objectOwnerID' => $this->userID diff --git a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php index bc03823b07..8b221925ee 100644 --- a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php @@ -5,7 +5,7 @@ use wcf\data\like\object\AbstractLikeObject; use wcf\data\like\Like; use wcf\data\object\type\ObjectTypeCache; use wcf\system\comment\CommentHandler; -use wcf\system\user\notification\object\CommentResponseLikeUserNotificationObject; +use wcf\system\user\notification\object\LikeUserNotificationObject; use wcf\system\user\notification\UserNotificationHandler; use wcf\system\WCF; @@ -66,7 +66,7 @@ class LikeableCommentResponse extends AbstractLikeObject { if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.response.like.notification')) { $notificationObjectType = UserNotificationHandler::getInstance()->getObjectTypeProcessor($objectType->objectType.'.response.like.notification'); if ($this->userID != WCF::getUser()->userID) { - $notificationObject = new CommentResponseLikeUserNotificationObject($like); + $notificationObject = new LikeUserNotificationObject($like); UserNotificationHandler::getInstance()->fireEvent('like', $objectType->objectType.'.response.like.notification', $notificationObject, array($this->userID), array( 'commentID' => $comment->commentID, 'commentUserID' => $comment->userID, diff --git a/wcfsetup/install/files/lib/system/user/notification/object/CommentLikeUserNotificationObject.class.php b/wcfsetup/install/files/lib/system/user/notification/object/CommentLikeUserNotificationObject.class.php deleted file mode 100644 index 9ce13fae75..0000000000 --- a/wcfsetup/install/files/lib/system/user/notification/object/CommentLikeUserNotificationObject.class.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.user.notification.object - * @category Community Framework - */ -class CommentLikeUserNotificationObject extends DatabaseObjectDecorator implements IUserNotificationObject { - /** - * @see \wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\like\Like'; - - /** - * @see \wcf\system\user\notification\object\IUserNotificationObject::getTitle() - */ - public function getTitle() { - return ''; - } - - /** - * @see \wcf\system\user\notification\object\IUserNotificationObject::getURL() - */ - public function getURL() { - return ''; - } - - /** - * @see \wcf\system\user\notification\object\IUserNotificationObject::getAuthorID() - */ - public function getAuthorID() { - return $this->userID; - } -} diff --git a/wcfsetup/install/files/lib/system/user/notification/object/CommentResponseLikeUserNotificationObject.class.php b/wcfsetup/install/files/lib/system/user/notification/object/CommentResponseLikeUserNotificationObject.class.php deleted file mode 100644 index e57e6d9bc7..0000000000 --- a/wcfsetup/install/files/lib/system/user/notification/object/CommentResponseLikeUserNotificationObject.class.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.user.notification.object - * @category Community Framework - */ -class CommentResponseLikeUserNotificationObject extends DatabaseObjectDecorator implements IUserNotificationObject { - /** - * @see \wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\like\Like'; - - /** - * @see \wcf\system\user\notification\object\IUserNotificationObject::getTitle() - */ - public function getTitle() { - return ''; - } - - /** - * @see \wcf\system\user\notification\object\IUserNotificationObject::getURL() - */ - public function getURL() { - return ''; - } - - /** - * @see \wcf\system\user\notification\object\IUserNotificationObject::getAuthorID() - */ - public function getAuthorID() { - return $this->userID; - } -} diff --git a/wcfsetup/install/files/lib/system/user/notification/object/LikeUserNotificationObject.class.php b/wcfsetup/install/files/lib/system/user/notification/object/LikeUserNotificationObject.class.php new file mode 100644 index 0000000000..80ed30069e --- /dev/null +++ b/wcfsetup/install/files/lib/system/user/notification/object/LikeUserNotificationObject.class.php @@ -0,0 +1,41 @@ + + * @package com.woltlab.wcf + * @subpackage system.user.notification.object + * @category Community Framework + */ +class LikeUserNotificationObject extends DatabaseObjectDecorator implements IUserNotificationObject { + /** + * @see \wcf\data\DatabaseObjectDecorator::$baseClass + */ + protected static $baseClass = 'wcf\data\like\Like'; + + /** + * @see \wcf\system\user\notification\object\IUserNotificationObject::getTitle() + */ + public function getTitle() { + return ''; + } + + /** + * @see \wcf\system\user\notification\object\IUserNotificationObject::getURL() + */ + public function getURL() { + return ''; + } + + /** + * @see \wcf\system\user\notification\object\IUserNotificationObject::getAuthorID() + */ + public function getAuthorID() { + return $this->userID; + } +} diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php new file mode 100644 index 0000000000..9e85c0cd16 --- /dev/null +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/LikeUserNotificationObjectType.class.php @@ -0,0 +1,30 @@ + + * @package com.woltlab.wcf + * @subpackage system.user.notification.object.type + * @category Community Framework + */ +class LikeUserNotificationObjectType extends AbstractUserNotificationObjectType { + /** + * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$decoratorClassName + */ + protected static $decoratorClassName = 'wcf\system\user\notification\object\LikeUserNotificationObject'; + + /** + * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$objectClassName + */ + protected static $objectClassName = 'wcf\data\like\Like'; + + /** + * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$objectListClassName + */ + protected static $objectListClassName = 'wcf\data\like\LikeList'; +} diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentLikeUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentLikeUserNotificationObjectType.class.php deleted file mode 100644 index f8856b004d..0000000000 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentLikeUserNotificationObjectType.class.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.user.notification.object.type - * @category Community Framework - */ -class UserProfileCommentLikeUserNotificationObjectType extends AbstractUserNotificationObjectType implements ICommentUserNotificationObjectType { - /** - * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$decoratorClassName - */ - protected static $decoratorClassName = 'wcf\system\user\notification\object\CommentLikeUserNotificationObject'; - - /** - * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$objectClassName - */ - protected static $objectClassName = 'wcf\data\like\Like'; - - /** - * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$objectListClassName - */ - protected static $objectListClassName = 'wcf\data\like\LikeList'; - - /** - * @see \wcf\system\user\notification\object\type\ICommentUserNotificationObjectType::getOwnerID() - */ - public function getOwnerID($objectID) { - $sql = "SELECT objectUserID - FROM wcf".WCF_N."_like - WHERE likeID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($objectID)); - $row = $statement->fetchArray(); - - return ($row ? $row['objectUserID'] : 0); - } -} diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentResponseLikeUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentResponseLikeUserNotificationObjectType.class.php deleted file mode 100644 index 33c45b14d2..0000000000 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentResponseLikeUserNotificationObjectType.class.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.user.notification.object.type - * @category Community Framework - */ -class UserProfileCommentResponseLikeUserNotificationObjectType extends AbstractUserNotificationObjectType { - /** - * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$decoratorClassName - */ - protected static $decoratorClassName = 'wcf\system\user\notification\object\CommentResponseUserNotificationObject'; - - /** - * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$objectClassName - */ - protected static $objectClassName = 'wcf\data\comment\response\CommentResponse'; - - /** - * @see \wcf\system\user\notification\object\type\AbstractUserNotificationObjectType::$objectListClassName - */ - protected static $objectListClassName = 'wcf\data\comment\response\CommentResponseList'; -}