MediaType::setDefaultOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Mykees\MediaBundle\Form\Type;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8
9
class MediaType extends AbstractType
10
{
11
    /**
12
     * @param FormBuilderInterface $builder
13
     * @param array $options
14
     */
15
    public function buildForm(FormBuilderInterface $builder, array $options)
16
    {
17
        $builder
18
            ->add('fileData','file')
19
        ;
20
    }
21
    
22
    /**
23
     * @param OptionsResolverInterface $resolver
24
     */
25
    public function setDefaultOptions(OptionsResolverInterface $resolver)
26
    {
27
        $resolver->setDefaults(array(
28
            'data_class' => 'Mykees\MediaBundle\Entity\Media'
29
        ));
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getName()
36
    {
37
        return 'mykees_mediabundle_media';
38
    }
39
}
40