private static function extractEntityDescriptors(EntitiesDescriptor $entity)
    {
        $results = [];
        foreach ($entity->children as $child) {
            if ($child instanceof EntityDescriptor) {
                $results[] = $child;
                continue;
            }

            $results = array_merge($results, self::extractEntityDescriptors($child));
        }
        return $results;
    }