Add TUserLookupPageHandler::isValid()
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 16:07:35 +0000 (18:07 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 16:07:35 +0000 (18:07 +0200)
wcfsetup/install/files/lib/system/page/handler/TUserLookupPageHandler.class.php

index c82ea8e08ca31bb4b6c79cfc87d201340a801695..38c157f03a3e387022829794261f9139d5f26ee7 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 namespace wcf\system\page\handler;
 use wcf\data\user\UserProfileList;
+use wcf\system\cache\runtime\UserRuntimeCache;
 
 /**
- * Provides the `lookup` method for looking up users. 
+ * Provides the `isValid` and `lookup` methods for looking up users. 
  * 
  * @author     Matthias Schmidt
  * @copyright  2001-2016 WoltLab GmbH
@@ -12,6 +13,13 @@ use wcf\data\user\UserProfileList;
  * @since      3.0
  */
 trait TUserLookupPageHandler {
+       /**
+        * @see ILookupPageHandler::isValid()
+        */
+       public function isValid($objectID) {
+               return UserRuntimeCache::getInstance()->getObject($objectID) !== null;
+       }
+       
        /**
         * @see ILookupPageHandler::lookup()
         */