TranslationMessageType::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Sleepness\UberTranslationAdminBundle\Form\Type;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
9
/**
10
 * Class for form edit message translation
11
 *
12
 * @author Viktor Novikov <[email protected]>
13
 */
14
class TranslationMessageType extends AbstractType
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function buildForm(FormBuilderInterface $builder, array $options)
20
    {
21
        $builder
22
            ->add('locale', 'text')
23
            ->add('domain', 'text')
24
            ->add('key', 'text')
25
            ->add('translation', 'textarea', array(
26
                'attr'  => array(
27
                    'rows' => 4,
28
                    'cols' => 45,
29
                )
30
            ));
31
    }
32
33
    /**
34
     * {@inheritDoc}
35
     */
36
    public function configureOptions(OptionsResolver $resolver)
37
    {
38
        $resolver->setDefaults(array(
39
            'data_class' => 'Sleepness\UberTranslationAdminBundle\Form\Model\TranslationModel',
40
        ));
41
    }
42
43
    /**
44
     * {@inheritDoc}
45
     */
46
    public function getName()
47
    {
48
        return 'translation_form';
49
    }
50
} 
51