Small optimization
authorMarcel Werk <burntime@woltlab.com>
Thu, 6 Jun 2013 01:36:01 +0000 (03:36 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 6 Jun 2013 01:36:01 +0000 (03:36 +0200)
wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php

index 45d4317d775f4960190836f050cf3bb23daaf1f3..b4bf125f79bd546e8b22963221ed8cb4698be4b0 100644 (file)
@@ -162,6 +162,20 @@ class ObjectTypeCache extends SingletonFactory {
                return null;
        }
        
+       /**
+        * Gets the object type id with the given definition name and given name.
+        *
+        * @param       string          $definitionName
+        * @param       string          $objectTypeName
+        * @return      integer
+        */
+       public function getObjectTypeIDByName($definitionName, $objectTypeName) {
+               $objectType = $this->getObjectTypeByName($definitionName, $objectTypeName);
+               if ($objectType !== null) return $objectType->objectTypeID;
+               
+               return null;
+       }
+       
        /**
         * Resets and reloads the object type cache.
         */