public static function getAllEntityClassNames(EntityManager $entityManager)
    {
        $classes = [];

        foreach ($entityManager->getMetadataFactory()->getAllMetadata() as $meta) {
            $classes[] = $meta->getName();
        }

        return $classes;
    }