VideoFileType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 7 1
A configureOptions() 0 5 1
A getBlockPrefix() 0 3 1
1
<?php
2
3
namespace AppBundle\Form;
4
5
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
use Vich\UploaderBundle\Form\Type\VichFileType;
10
11
class VideoFileType extends AbstractType
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function buildForm(FormBuilderInterface $builder, array $options)
17
    {
18
        $builder
19
            ->add('videoFile', VichFileType::class, [
20
                'allow_delete' => false,
21
                'required' => true,
22
                'label' => 'form_create.file',
23
            ]);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function configureOptions(OptionsResolver $resolver)
30
    {
31
        $resolver->setDefaults(array(
32
            'data_class' => 'AppBundle\Entity\Video',
33
            'translation_domain' => 'video',
34
        ));
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getBlockPrefix()
41
    {
42
        return 'appbundle_video';
43
    }
44
}
45