src/Flowcode/ShopBundle/Form/ServiceType.php
/**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
@param FormBuilderInterface $builder
@param array $options
@param FormBuilderInterface $builder @param array $options
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('detail')
            ->add('price')
            ->add('description')
            ->add('category', EntityType::class, array(
                'class' => Category::class,
                'choices' => $this->categoryService->findByRoot("service"),
                'choice_label' => function ($category) {
                    return strtolower($category->getName());
                },
                'multiple' => false,
            ))
        ;
    }
public function buildForm ( FormBuilderInterface $ builder , array $ options ) { $ builder -> add ( 'name' ) -> add ( 'detail' ) -> add ( 'price' ) -> add ( 'description' ) -> add ( 'category' , EntityType :: class , array ( 'class' => Category :: class , 'choices' => $ this -> categoryService -> findByRoot ( " service " ) , 'choice_label' => function ( $ category ) { return strtolower ( $ category -> getName ( ) ) ; } , 'multiple' => false , ) ) ; }
@param FormBuilderInterface $builder
 @param array $options
@param FormBuilderInterface $builder @param array $options