Add method to get a reaction type by id in the reaction handler
authorJoshua Rüsweg <josh@bastelstu.be>
Mon, 21 May 2018 14:34:39 +0000 (16:34 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Mon, 21 May 2018 14:34:39 +0000 (16:34 +0200)
See #2508

wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php

index cdbe94b994ade4ddbcdc738bf273b60de843d7e8..3a23a28ee5214eba5981e1d45a629d79071546f3 100644 (file)
@@ -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])) {