src/PHPDish/Bundle/PostBundle/Form/Type/PostType.php
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('title', TextType::class, [
                'label' => 'form.post.title',
            ])
            ->add('category', EntityType::class, [
                'class' => 'PHPDishPostBundle:Category',
                'choice_label' => 'name',
                'choices' => $this->getCurrentUserCategories($options),
            ])
            ->add('originalBody', TextareaType::class, [
                'label' => 'form.post.body',
            ]);
    }
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('title', TextType::class, [
                'label' => 'form.post.title',
            ])
            ->add('category', EntityType::class, [
                'class' => 'PHPDishPostBundle:Category',
                'choice_label' => 'name',
                'choices' => $this->getCurrentUserCategories($options),
            ])
            ->add('originalBody', TextareaType::class, [
                'label' => 'form.post.body',
            ]);
    }
{@inheritdoc}