From 272e7c4f4ab622b9ef0f5843458cdfdfaf4f1182 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 6 Jun 2013 03:36:01 +0200 Subject: [PATCH] Small optimization --- .../lib/data/object/type/ObjectTypeCache.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php b/wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php index 45d4317d77..b4bf125f79 100644 --- a/wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php +++ b/wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php @@ -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. */ -- 2.20.1