Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doctrine] Support for query_builder in entity form field type #426

Closed
Azenet opened this issue Jan 23, 2015 · 0 comments
Closed

[Doctrine] Support for query_builder in entity form field type #426

Azenet opened this issue Jan 23, 2015 · 0 comments

Comments

@Azenet
Copy link

Azenet commented Jan 23, 2015

Would it be possible to have the same autocompletion support that exists in entity repositories for this kind of thing :

class MyFormType extends AbstractType {
    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
            ->add('field', 'entity', array(
                'class' => 'MyBundle:MyEntity',
                'query_builder' => function (EntityRepository $er) {
                    return $er->createQueryBuilder('e')
                        ->where('e.myField = :field')
                        ->setParameter('field', 'blah'); //setParameter already has completion from the where field
                }
            ));
    }
}
@Azenet Azenet changed the title Support for query_builder in entity FormTypes Support for query_builder in entity form field type Jan 23, 2015
@Haehnchen Haehnchen added the todo label Apr 20, 2015
@Haehnchen Haehnchen changed the title Support for query_builder in entity form field type [Doctrine] Support for query_builder in entity form field type May 10, 2015
Haehnchen added a commit that referenced this issue May 14, 2015
@Haehnchen Haehnchen added fixed and removed todo labels May 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants