BatchType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Ivoaz ContentEditable bundle.
5
 *
6
 * (c) Ivo Azirjans <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Ivoaz\Bundle\ContentEditableBundle\Form\Type;
13
14
use Ivoaz\Bundle\ContentEditableBundle\Form\Model\Batch;
15
use Symfony\Component\Form\AbstractType;
16
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
17
use Symfony\Component\Form\FormBuilderInterface;
18
use Symfony\Component\OptionsResolver\OptionsResolver;
19
20
/**
21
 * @author Ivo Azirjans <[email protected]>
22
 */
23
class BatchType extends AbstractType
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function buildForm(FormBuilderInterface $builder, array $options)
29
    {
30 1
        $builder->add(
31 1
            'contents',
32 1
            CollectionType::class,
33 1
            ['entry_type' => BatchContentType::class, 'allow_add' => true, 'allow_delete' => true]
34 1
        );
35 1
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 1
    public function configureOptions(OptionsResolver $resolver)
41
    {
42 1
        $resolver->setDefaults(
43
            [
44 1
                'data_class'      => Batch::class,
45 1
                'csrf_protection' => false,
46 1
                'method'          => 'POST',
47
            ]
48 1
        );
49 1
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 1
    public function getBlockPrefix()
55
    {
56 1
        return '';
57
    }
58
}
59