diff --git a/core/kernel/classes/class.Resource.php b/core/kernel/classes/class.Resource.php index b55ac2f30..224c1e4b7 100644 --- a/core/kernel/classes/class.Resource.php +++ b/core/kernel/classes/class.Resource.php @@ -763,7 +763,13 @@ public function equals(core_kernel_classes_Resource $resource): bool */ public function isInstanceOf(core_kernel_classes_Class $class): bool { - return in_array($class->getUri(), $this->getParentClassesIds(), true); + foreach ($this->getTypes() as $type) { + if ($class->equals($type) || $type->isSubClassOf($class)) { + return true; + } + } + + return false; } public function getRootId(): string