From: Joshua Rüsweg Date: Mon, 21 May 2018 14:34:39 +0000 (+0200) Subject: Add method to get a reaction type by id in the reaction handler X-Git-Tag: 5.2.0_Alpha_1~364^2~101^2~111 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=afc11566b4aaeb3ad7bca80b0a8a43820643ae8d;p=GitHub%2FWoltLab%2FWCF.git Add method to get a reaction type by id in the reaction handler See #2508 --- 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])) {