From afc11566b4aaeb3ad7bca80b0a8a43820643ae8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Mon, 21 May 2018 16:34:39 +0200 Subject: [PATCH] Add method to get a reaction type by id in the reaction handler See #2508 --- .../lib/system/reaction/ReactionHandler.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index cdbe94b994..3a23a28ee5 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -72,6 +72,16 @@ class ReactionHandler extends SingletonFactory { return JSON::encode($returnValues); } + /** + * Returns a reaction type by id. + * + * @param integer $reactionID + * @return ReactionType|null + */ + public function getReactionTypeByID($reactionID) { + return ReactionTypeCache::getInstance()->getReactionTypeByID($reactionID); + } + /** * Builds the data attributes for the object container. * @@ -122,8 +132,8 @@ class ReactionHandler extends SingletonFactory { /** * Returns an object type from cache. * - * @param string $objectName - * @return ObjectType + * @param string $objectName + * @return ObjectType|null */ public function getObjectType($objectName) { if (isset($this->cache[$objectName])) { -- 2.20.1