CustomBlockType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Lakion\CmsPlugin\Form\Type;
4
5
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
6
use Symfony\Component\Form\Extension\Core\Type\FileType;
7
use Symfony\Component\Form\Extension\Core\Type\TextType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
10
final class CustomBlockType extends AbstractResourceType
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function buildForm(FormBuilderInterface $builder, array $options = [])
16
    {
17
        $builder
18
            ->add('name', TextType::class, [
19
                'label' => 'lakion_cms.form.custom_block.name',
20
            ])
21
            ->add('title', TextType::class, [
22
                'label' => 'lakion_cms.form.custom_block.title',
23
            ])
24
            ->add('body', TextType::class, [
25
                'label' => 'lakion_cms.form.custom_block.body',
26
            ])
27
            ->add('linkUrl', TextType::class, [
28
                'label' => 'lakion_cms.form.custom_block.link',
29
            ])
30
            ->add('image', FileType::class, [
31
                'label' => 'lakion_cms.form.custom_block.image',
32
            ])
33
        ;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getBlockPrefix()
40
    {
41
        return 'lakion_cms_custom_block';
42
    }
43
}
44