diff --git a/src/core/App.php b/src/core/App.php index a945563e9b..3c35556c5c 100644 --- a/src/core/App.php +++ b/src/core/App.php @@ -3324,9 +3324,13 @@ function getRegisteredEntityTypeByTypeName(Entity|string $entity, string $type_n * @return Definitions\EntityType[] */ function getRegisteredEntityTypes(Entity|string $entity): array { - if(is_object($entity)) + if (is_object($entity)) $entity = $entity->getClassName(); + usort($this->_register['entity_types'][$entity], function ($a, $b) { + return strcmp($a->name, $b->name); + }); + return $this->_register['entity_types'][$entity] ?? []; }