I have my own custom view, which is a combination of various objects, which makes sense to the end user using the following code:
$form = $this->container->get('form.factory')->createNamedBuilder(null, 'form') ->add('country', 'entity', array( 'class' => 'ACME\MyBundle\Entity\Country', 'query_builder' => function(EntityRepository $er) { return $er->createQueryBuilder('c')->orderBy('c.en_name', 'ASC'); }, 'label' => '* Country', 'required' => true ), )
The code seems great even when reviewing the documentation http://symfony.com/doc/current/reference/forms/types/entity.html#reference-forms-entity-choices , but I keep getting the error below:
The options "class", "query_builder" do not exist. Known options are: "action", "attr", "auto_initialize", "block_name", "by_reference", "cascade_validation", "choice_list", "choices", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_provider", "csrf_token_id", "csrf_token_manager", "data", "data_class", "disabled", "empty_data", "empty_value", "error_bubbling", "error_mapping", "expanded", "extra_fields_message", "inherit_data", "intention", "invalid_message", "invalid_message_parameters", "js_validation", "label", "label_attr", "label_render", "mapped", "max_length", "method", "multiple", "pattern", "post_max_size_message", "preferred_choices", "property_path", "read_only", "required", "sonata_admin", "sonata_field_description", "translation_domain", "trim", "validation_groups", "virtual"
I donβt know what I donβt have, and I will be grateful for your help.