public static function newEntityType($class, array $choices = [], array $options = []) {

        // Check the options.
        if (false === array_key_exists("empty", $options)) {
            $options["empty"] = false;
        }
        if (false === array_key_exists("translator", $options)) {
            $options["translator"] = null;
        }

        // Initialize the output.
        $output = [
            "class"        => $class,
            "choices"      => [],
            "choice_label" => function($entity) use ($options) {
                return FormRenderer::renderOption($entity, $options["translator"]);
            },
        ];

        // Add an empty choice.
        if (true === $options["empty"]) {
            $output["choices"][] = null;
        }

        // Add all choices.
        $output["choices"] = array_merge($output["choices"], $choices);

        return $output;
    }