From c5bf8a31cb3ee63fd90be82c945de558633e4750 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 6 Sep 2010 04:19:44 +0000 Subject: [PATCH] ENHANCEMENT #5977 Added optional argument to ClassInfo::getValidSubClasses() and removed harcoded SiteTree git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110467 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/ClassInfo.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/ClassInfo.php b/core/ClassInfo.php index 035c2ab20..89fbfb158 100755 --- a/core/ClassInfo.php +++ b/core/ClassInfo.php @@ -52,9 +52,10 @@ class ClassInfo { /** * Returns the manifest of all classes which are present in the database. + * @param string $class Class name to check enum values for ClassName field */ - static function getValidSubClasses(){ - return DB::getConn()->enumValuesForField("SiteTree", "ClassName"); + static function getValidSubClasses($class = 'SiteTree') { + return DB::getConn()->enumValuesForField($class, 'ClassName'); } /**